The length of the value of an annotation can be up to 256K. However, podman kube play limits it to 63 characters. It seems that there was a misunderstanding of the specification when this limitation enforcement was added. The correct limitations on annotations are:
Key
May have two parts prefix and name separated by /:
The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/).
The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.
See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set
Value
For some reason the maximal length is not specified in the documentation. However, according to this the limit is 256K.
Steps to reproduce the issue
Steps to reproduce the issue
Create the following Pod YAML file: /tmp/fedora.yml. Notice the length of the value of the annotation foo is 120 characters
Error: annotation "foo"="abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh" value length exceeds Kubernetes max 63
Running kubectl apply -f /tmp/fedora.yml works fine and does not truncate the value
podman kube play provides a mechanism to override the length enforcement by setting --no-trunc. However, since the limitation is false, I think it's still important to fix the limitations. This is even more important in podman generate kube since by default it will truncate the value (again, unless --no-trunc is set.
Issue Description
The length of the value of an annotation can be up to 256K. However,
podman kube play
limits it to 63 characters. It seems that there was a misunderstanding of the specification when this limitation enforcement was added. The correct limitations on annotations are:Key May have two parts
prefix
andname
separated by/
: The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-setValue For some reason the maximal length is not specified in the documentation. However, according to this the limit is 256K.
Steps to reproduce the issue
Steps to reproduce the issue
/tmp/fedora.yml
. Notice the length of the value of the annotationfoo
is 120 charactersDescribe the results you received
Error: annotation "foo"="abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh" value length exceeds Kubernetes max 63
Describe the results you expected
The operation should have been successful.
podman info output
Podman in a container
Yes
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Running
kubectl apply -f /tmp/fedora.yml
works fine and does not truncate the valuepodman kube play
provides a mechanism to override the length enforcement by setting--no-trunc
. However, since the limitation is false, I think it's still important to fix the limitations. This is even more important inpodman generate kube
since by default it will truncate the value (again, unless--no-trunc
is set.