You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With both data and stringData, regardless of where the reference is set, vals fails:
$ cat secret.yaml
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: test
data:
foo: YmFy
stringData:
MY_SUPER_SECRET: "[REDACTED]"
$ vals eval --decode-kubernetes-secrets < secret.yaml
yaml: unmarshal errors:
line 9: mapping key "stringData" already defined at line 7
$ vals ksdecode -f secret.yaml
yaml: unmarshal errors:
line 9: mapping key "stringData" already defined at line 7
$ cat secret.yaml
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: test
data:
MY_SUPER_SECRET: "[REDACTED]"
stringData:
foo: bar
$ vals eval --decode-kubernetes-secrets < secret.yaml
yaml: unmarshal errors:
line 9: mapping key "stringData" already defined at line 7
$ vals ksdecode -f secret.yaml
yaml: unmarshal errors:
line 9: mapping key "stringData" already defined at line 7
I’m running the latest version:
$ vals version
Version: 0.37.5
Git Commit: 4e977c561c3f09b8f16845e55cb8b72f1ae4d8b6
The text was updated successfully, but these errors were encountered:
johanfleury
changed the title
Decoding of Kubernetes Secrets fails when Secrets has both data and stringData
Decoding of Kubernetes Secrets fails when Secret has both data and stringData
Sep 12, 2024
When a Secret has both
data
andstringData
, vals fails to decode it withmapping key "stringData" already defined at line x
.My guess from the error message is that vals tries to add a new
stringData
key instead of merging data with the existing one.With only
data
orstringData
, vals works well:With both
data
andstringData
, regardless of where the reference is set, vals fails:I’m running the latest version:
The text was updated successfully, but these errors were encountered: