From cc846a8cd901705316e2b06013beb5c6bde44bfc Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 9 Feb 2021 08:25:59 -0500 Subject: 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 --- pkg/specgen/generate/container.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkg/specgen') 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 -- cgit v1.2.3-54-g00ecf