mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
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>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user