summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-03-09 17:30:01 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-03-09 17:30:01 -0500
commitfeaa1a134a4fd0a7d25bab485708a201321bfb56 (patch)
tree080fa2a13998bc0b9f3c0689df6317f736aa8d02 /pkg/specgen
parentacfcecf2ae41528d1d7ecd43d37d8fd554f587bc (diff)
downloadpodman-feaa1a134a4fd0a7d25bab485708a201321bfb56.tar.gz
podman-feaa1a134a4fd0a7d25bab485708a201321bfb56.tar.bz2
podman-feaa1a134a4fd0a7d25bab485708a201321bfb56.zip
Add podman play kube --annotation
Allow users to add annotions in the podman play kube command. This PR Also fixes the fact that annotations in the pod spec were not being passed down to containers. Fixes: https://github.com/containers/podman/issues/12968 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/generate/kube/kube.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go
index 5e6671231..e0331b0a6 100644
--- a/pkg/specgen/generate/kube/kube.go
+++ b/pkg/specgen/generate/kube/kube.go
@@ -277,7 +277,13 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener
}
annotations := make(map[string]string)
+ if opts.Annotations != nil {
+ annotations = opts.Annotations
+ }
if opts.PodInfraID != "" {
+ if annotations == nil {
+
+ }
annotations[ann.SandboxID] = opts.PodInfraID
annotations[ann.ContainerType] = ann.ContainerTypeContainer
}