summaryrefslogtreecommitdiff
path: root/libpod/define
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-04-26 15:53:36 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-04-27 04:39:05 -0400
commit7259a6315c7f7d97665d928de6357fc3cbcae136 (patch)
treea47443744f1e5cd7504e15bba29fb0a661ef6f3d /libpod/define
parent5ac00a7287e4a9e6292f4a6ca5dfa9a02e5ca907 (diff)
downloadpodman-7259a6315c7f7d97665d928de6357fc3cbcae136.tar.gz
podman-7259a6315c7f7d97665d928de6357fc3cbcae136.tar.bz2
podman-7259a6315c7f7d97665d928de6357fc3cbcae136.zip
Truncate annotations when generating kubernetes yaml files
Kubernetes only allows 63 characters in an annotation. Make sure that we only add 63 or less charaters when generating kube. Warn if containers or pods have longer length and truncate. Discussion: https://github.com/containers/podman/discussions/13901 Fixes: https://github.com/containers/podman/issues/13962 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/define')
-rw-r--r--libpod/define/annotations.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/libpod/define/annotations.go b/libpod/define/annotations.go
index a83fbff0b..8f5279981 100644
--- a/libpod/define/annotations.go
+++ b/libpod/define/annotations.go
@@ -135,6 +135,8 @@ const (
// creating a checkpoint image to specify the name of host distribution on
// which the checkpoint was created.
CheckpointAnnotationDistributionName = "io.podman.annotations.checkpoint.distribution.name"
+ // MaxKubeAnnotation is the max length of annotations allowed by Kubernetes.
+ MaxKubeAnnotation = 63
)
// IsReservedAnnotation returns true if the specified value corresponds to an