diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-03-10 14:36:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 14:36:53 -0500 |
commit | 7ba81ead38d0c4fb2e583224257a0497789552fc (patch) | |
tree | f7e546f59992980f64b75857a2e5aa0b4751a62b /pkg/domain/infra | |
parent | a5e327941423983529b771a03691dc2fe2390e0f (diff) | |
parent | feaa1a134a4fd0a7d25bab485708a201321bfb56 (diff) | |
download | podman-7ba81ead38d0c4fb2e583224257a0497789552fc.tar.gz podman-7ba81ead38d0c4fb2e583224257a0497789552fc.tar.bz2 podman-7ba81ead38d0c4fb2e583224257a0497789552fc.zip |
Merge pull request #13445 from rhatdan/annotation
Add podman play kube --annotation
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r-- | pkg/domain/infra/abi/play.go | 7 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/play.go | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 155b06105..3242e64a2 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -79,6 +79,13 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, path string, options en podTemplateSpec.ObjectMeta = podYAML.ObjectMeta podTemplateSpec.Spec = podYAML.Spec + for name, val := range options.Annotations { + if podYAML.Annotations == nil { + podYAML.Annotations = make(map[string]string) + } + podYAML.Annotations[name] = val + } + r, err := ic.playKubePod(ctx, podTemplateSpec.ObjectMeta.Name, &podTemplateSpec, options, &ipIndex, podYAML.Annotations, configMaps) if err != nil { return nil, err diff --git a/pkg/domain/infra/tunnel/play.go b/pkg/domain/infra/tunnel/play.go index 55844730b..cd51262d0 100644 --- a/pkg/domain/infra/tunnel/play.go +++ b/pkg/domain/infra/tunnel/play.go @@ -16,6 +16,9 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, path string, opts entit if len(opts.LogOptions) > 0 { options.WithLogOptions(opts.LogOptions) } + if opts.Annotations != nil { + options.WithAnnotations(opts.Annotations) + } options.WithNoHosts(opts.NoHosts) if s := opts.SkipTLSVerify; s != types.OptionalBoolUndefined { options.WithSkipTLSVerify(s == types.OptionalBoolTrue) |