aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-27 09:42:31 -0400
committerGitHub <noreply@github.com>2022-04-27 09:42:31 -0400
commitbbe419ef9ffda699aa87ab0fcb2bdf50c0ff5058 (patch)
tree85bf123d2a7e1c3439d7a2da9e4656eabfbf1fb7 /cmd
parentc44efb011003942adedb6ac74457be0123d23a02 (diff)
parent7259a6315c7f7d97665d928de6357fc3cbcae136 (diff)
downloadpodman-bbe419ef9ffda699aa87ab0fcb2bdf50c0ff5058.tar.gz
podman-bbe419ef9ffda699aa87ab0fcb2bdf50c0ff5058.tar.bz2
podman-bbe419ef9ffda699aa87ab0fcb2bdf50c0ff5058.zip
Merge pull request #14023 from rhatdan/kube
Truncate annotations when generating kubernetes yaml files
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/play/kube.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go
index e92516eb4..40d14a609 100644
--- a/cmd/podman/play/kube.go
+++ b/cmd/podman/play/kube.go
@@ -178,7 +178,11 @@ func kube(cmd *cobra.Command, args []string) error {
if kubeOptions.Annotations == nil {
kubeOptions.Annotations = make(map[string]string)
}
- kubeOptions.Annotations[splitN[0]] = splitN[1]
+ annotation := splitN[1]
+ if len(annotation) > define.MaxKubeAnnotation {
+ return errors.Errorf("annotation exceeds maximum size, %d, of kubernetes annotation: %s", define.MaxKubeAnnotation, annotation)
+ }
+ kubeOptions.Annotations[splitN[0]] = annotation
}
yamlfile := args[0]
if yamlfile == "-" {