summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/container.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-09 18:40:36 -0500
committerGitHub <noreply@github.com>2021-02-09 18:40:36 -0500
commit2d829aeb1fe0dc19c45e796141ab78ff192b5dbb (patch)
treed1250fe1db1339b3f56eccf980aa74a4ec395ef2 /pkg/specgen/generate/container.go
parent8600c3b8e2436d73c7c13deb0da869b7f35069ea (diff)
parent46385dd609efb3ab36d326f9e32b6e04f31d8867 (diff)
downloadpodman-2d829aeb1fe0dc19c45e796141ab78ff192b5dbb.tar.gz
podman-2d829aeb1fe0dc19c45e796141ab78ff192b5dbb.tar.bz2
podman-2d829aeb1fe0dc19c45e796141ab78ff192b5dbb.zip
Merge pull request #9284 from rhatdan/annotations
Support annotations from containers.conf
Diffstat (limited to 'pkg/specgen/generate/container.go')
-rw-r--r--pkg/specgen/generate/container.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index 31d317bf8..f2af9dd5f 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -3,6 +3,7 @@ package generate
import (
"context"
"os"
+ "strings"
"github.com/containers/image/v5/manifest"
"github.com/containers/podman/v2/libpod"
@@ -197,6 +198,15 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
annotations[ann.ContainerType] = ann.ContainerTypeContainer
}
+ for _, v := range rtc.Containers.Annotations {
+ split := strings.SplitN(v, "=", 2)
+ k := split[0]
+ v := ""
+ if len(split) == 2 {
+ v = split[1]
+ }
+ annotations[k] = v
+ }
// now pass in the values from client
for k, v := range s.Annotations {
annotations[k] = v