summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/container.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-02-09 08:25:59 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-02-09 13:18:18 -0500
commitcc846a8cd901705316e2b06013beb5c6bde44bfc (patch)
treed976fb2f804c4a5b4459e571b734d0fcaaa2002d /pkg/specgen/generate/container.go
parent763d522983b819ecd38689c9c0840069d1e2b530 (diff)
downloadpodman-cc846a8cd901705316e2b06013beb5c6bde44bfc.tar.gz
podman-cc846a8cd901705316e2b06013beb5c6bde44bfc.tar.bz2
podman-cc846a8cd901705316e2b06013beb5c6bde44bfc.zip
Support annotations from containers.conf
Currently podman does not use the annotations specified in the containers.conf. This PR fixes this. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
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