summaryrefslogtreecommitdiff
path: root/pkg/domain/infra
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 /pkg/domain/infra
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 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/abi/play.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go
index 5de475480..0da07bab8 100644
--- a/pkg/domain/infra/abi/play.go
+++ b/pkg/domain/infra/abi/play.go
@@ -78,7 +78,11 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options
podTemplateSpec.ObjectMeta = podYAML.ObjectMeta
podTemplateSpec.Spec = podYAML.Spec
-
+ for name, val := range podYAML.Annotations {
+ if len(val) > define.MaxKubeAnnotation {
+ return nil, errors.Errorf("invalid annotation %q=%q value length exceeds Kubernetetes max %d", name, val, define.MaxKubeAnnotation)
+ }
+ }
for name, val := range options.Annotations {
if podYAML.Annotations == nil {
podYAML.Annotations = make(map[string]string)