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 6 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 local domain="$1" renewal_file
renewal_file="$SERVICE_DATASTORE"/etc/letsencrypt/renewal/"$domain".conf renewal_file="$SERVICE_DATASTORE"/etc/letsencrypt/renewal/"$domain".conf
[ -e "$renewal_file" ] || return 1 [ -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() { 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. ## is totally wanted: cron does not support multilines.
exclude_dbs=$(relation-get exclude-dbs 2>/dev/null) || true 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 ## Warning: 'docker -v' will use HOST directory even if launched from
## 'cron' container. ## 'cron' container.

Loading…
Cancel
Save