Kubernetes secret and base64 data #16625
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Mounting/using a kubernetes secret does not behave the same as kubernetes.
A kubernetes secret value is is usually encoded in base64:
Mouting the above volume in a pod results in a file called "foo" with the conents "YmFy" instead of "bar".
Now there is a way to define non-base64 secret data by using
stringData
instead ofdata
:In this case podman ignores
stringData
entirely and no file gets created.Podman is dealing with
data
as if it wasstringData
and ignoringstringData
entirely, which is not the expected behaviour if your compare it to kubernetes.Steps to reproduce the issue:
Run
podman kube play --replace pod.yaml
"Get into the container":
odman exec -it mypod-app /bin/bash
Run
cat /etc/mysecret/foo
Describe the results you received:
This is what I get, the encoded base64 string, the expected value would be the decoded base64 value "bar".
Describe the results you expected:
This is the output I get from kubernetes (deploying the same yaml files):
I get the decoded value in my secret file which is what I would expect to happen in podman.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
orbrew info podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes, I built it from the main branch and got the same results.
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: