-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
/kind bug
Description
podman kube generate
takes e.g., volume names as is, but Kubernetes has naming rules that seem to differ from Docker Engine's.
Steps to reproduce the issue:
-
Create a container using Kubernetes-invalid names for volumes.
-
Run
podman kube generate > manifest.yml
. -
kubectl apply --filename=manifest.yml
.
Describe the results you received:
The Pod "xenodochialmaxwell-pod" is invalid:
* spec.volumes[0].name: Invalid value: "Users-myuser-devel-gitlab.com-bla-hui-lern-host-0": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
* spec.volumes[1].name: Invalid value: "Users-myuser-.config-git-host-1": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
* spec.volumes[2].name: Invalid value: "lern_vscodeserver-pvc": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
Describe the results you expected:
Valid names and ability to apply the Kubernetes manifest.
This applies to volume names, indeed to any type name.
Additional information you deem important (e.g. issue happens only occasionally):
Output of podman version
:
podman version
Client: Podman Engine
Version: 4.3.1
API Version: 4.3.1
Go Version: go1.18.8
Built: Wed Nov 9 21:43:58 2022
OS/Arch: darwin/amd64
Server: Podman Engine
Version: 4.3.0
API Version: 4.3.0
Go Version: go1.19.2
Built: Fri Oct 21 10:09:51 2022
OS/Arch: linux/amd64
Output of podman info
:
Not applicable.
Package info (e.g. output of rpm -q podman
or apt list podman
or brew info podman
):
Not applicable.
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.
Additional environment details (AWS, VirtualBox, physical, etc.):
macOS. Container created is VS Code dev container.