podman kube play: Secret metadata.labels not forwarded to Spec.Labels #28697
-
|
metadata.labels are not forwarded to Spec.Labels when a secret is created via kube play. Labels is always {} regardless of what is defined in metadata.labels. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Yes, this is a known gap in the For reference, the secret creation call looks roughly like: secretID, err := ic.Libpod.Secrets().Create(
secretName,
secretData,
secrets.CreateSecretOpts{
Driver: driver,
DriverOpts: driverOpts,
},
)There's no Workaround: create the secret manually with labels, then run echo -n "value" | podman secret create --label labelKey=labelValue test-secret -
podman kube play pod.yamlThis is worth filing as a bug (or even a PR if you're up for it). The fix would be straightforward — add a |
Beta Was this translation helpful? Give feedback.
-
Sure, would like to take this up :) |
Beta Was this translation helpful? Give feedback.
Yes, this is a known gap in the
kube playsecret handling. The code that converts Kubernetes Secret manifests to Podman secrets (pkg/domain/infra/abi/play.go,playKubeSecretfunction) creates the secret usingsecrets.CreateSecretOptsand only passesName,Driver, and the secret data. Themetadata.labelsfrom the YAML are parsed but never mapped toSpec.Labels.For reference, the secret creation call looks roughly like:
There's no
Labelsfield being set from the Kubernetes metadata.Workaround: create the secret manu…