Skip to content

Commit 13b545c

Browse files
committed
fix(keystone): render empty Secret data as {} instead of null
The keystone-fernet-keys and keystone-credential-keys Secrets rendered data: with no value, which YAML parses as null rather than an empty map. GitOps controllers that re-apply these Secrets on every sync (they are Helm pre-install hooks) can send that literal null through as a "clear this field" instruction, wiping the fernet/credential keys written out-of-band by the setup jobs and rotation cronjob. Render data: {} instead, which merges as a no-op. Assisted-by: Claude Sonnet 5.0 Change-Id: I93628b5cfd589b3d53d315d1eb6bf64d9ccba33c Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
1 parent ce8c706 commit 13b545c

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

keystone/templates/secret-credential-keys.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ metadata:
2424
"helm.sh/resource-policy": keep
2525
{{ tuple "identity" "credential" $envAll | include "helm-toolkit.snippets.custom_secret_annotations" | indent 4 }}
2626
type: Opaque
27-
data:
27+
data: {}
2828
{{- end }}

keystone/templates/secret-fernet-keys.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ metadata:
2525
"helm.sh/resource-policy": keep
2626
{{ tuple "identity" "fernet" $envAll | include "helm-toolkit.snippets.custom_secret_annotations" | indent 4 }}
2727
type: Opaque
28-
data:
28+
data: {}
2929
{{- end }}
3030
{{- end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
fixes:
3+
- |
4+
The ``keystone-fernet-keys`` and ``keystone-credential-keys`` Secrets
5+
rendered their ``data`` field as an empty/null value instead of an empty
6+
map. GitOps tools such as Argo CD track and re-apply these Secrets on
7+
every sync (since they are Helm ``pre-install`` hooks), and a patch that
8+
contains an explicit ``null`` for ``data`` clears any keys already
9+
present, wiping out the fernet/credential keys written out-of-band by
10+
the ``keystone-fernet-setup``/``keystone-credential-setup`` jobs and the
11+
fernet rotation cronjob. ``data`` is now rendered as an empty map
12+
(``{}``), which merges as a no-op instead of clearing the field.
13+
...

0 commit comments

Comments
 (0)