这是indexloc提供的服务,不要输入任何密码
Skip to content

kube generate must transform invalid names or throw fatal fault #16542

@sanmai-NL

Description

@sanmai-NL

/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:

  1. Create a container using Kubernetes-invalid names for volumes.

  2. Run podman kube generate > manifest.yml.

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.kubelocked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.macosMacOS (OSX) related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions