Browse Source

fix: [letsencrypt,postgres] avoid using ``xargs`` because of possible bug

We got ``Assertion failed: bc_ctl.arg_max >= LINE_MAX (xargs.c: main: 500)`` failure
when using ``xargs``. This fix use pure builtins and avoid ``xargs`` all together.
framadate
Valentin Lab 5 years ago
parent
commit
a9f07c3859
  1. 2
      letsencrypt/lib/common
  2. 3
      postgres/hooks/schedule_command-relation-joined

2
letsencrypt/lib/common

@ -73,7 +73,7 @@ letsencrypt_get_challenge_type() {
local domain="$1" renewal_file
renewal_file="$SERVICE_DATASTORE"/etc/letsencrypt/renewal/"$domain".conf
[ -e "$renewal_file" ] || return 1
grep '^pref_challs' "$renewal_file" | cut -f 2 -d "=" | xargs echo
grep '^pref_challs' "$renewal_file" | cut -f 2 -d "=" | nspc
}
letsencrypt_set_renew_before_expiry() {

3
postgres/hooks/schedule_command-relation-joined

@ -25,7 +25,8 @@ fi
## is totally wanted: cron does not support multilines.
exclude_dbs=$(relation-get exclude-dbs 2>/dev/null) || true
exclude_dbs=$(echo "$exclude_dbs" | shyaml get-values 2>/dev/null | xargs echo) || true
exclude_dbs=$(echo "$exclude_dbs" | shyaml get-values 2>/dev/null |
nspc) || true
## Warning: 'docker -v' will use HOST directory even if launched from
## 'cron' container.

Loading…
Cancel
Save