let the init container's temp file take its umask
fetch-secrets ran under umask 0227 for the files it writes, which made the mktemp file of grafana_secret_key mode 0400: the redirect of bao's stderr into it failed, every bao call in the helper answered 1, and the init container exited 1 before it stored or read the key. The umask now covers only the writes of put(), the helper chmods its own file, the script test runs under that umask, and a pod that does not start prints its init containers' logs.
This commit is contained in:
parent
bd0cff47f9
commit
f8fb71253e
1 changed files with 19 additions and 3 deletions
|
|
@ -418,7 +418,9 @@ let
|
|||
in
|
||||
lib.hasInfix "put swarm-grafana.secret \"$oidc\"" init
|
||||
&& lib.hasInfix "bearer=\"$(seeded secret/swarm/services/swarm-grafana/metrics/bearer)\"\nput metrics-bearer \"Bearer $bearer\"" init
|
||||
&& lib.hasInfix "umask 0227" init
|
||||
&& lib.hasInfix "( umask 0227; printf '%s' \"$2\" > \"$d/$1.new\" )" init
|
||||
# Only the writes take it: a temporary file made under it is not writable to its owner.
|
||||
&& !(lib.hasInfix "\numask 0227" init)
|
||||
&& lib.hasInfix "d=/run/grafana-secrets" init
|
||||
&& !(persistent init)
|
||||
&& !(persistent r.scripts.controllerToken)
|
||||
|
|
|
|||
Loading…
Reference in a new issue