summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-21 05:48:38 -0500
committerGitHub <noreply@github.com>2021-01-21 05:48:38 -0500
commit55982295dd05e7fcb1fed3883aea3b2027e369af (patch)
tree58cabf506e626b2114aed6083534b77c1db107df /pkg
parent14443ccdfc19a7d719c63937ce76bfddf01f88e2 (diff)
parentf43046745386d8cd15e010a6ade65619ad12b383 (diff)
downloadpodman-55982295dd05e7fcb1fed3883aea3b2027e369af.tar.gz
podman-55982295dd05e7fcb1fed3883aea3b2027e369af.tar.bz2
podman-55982295dd05e7fcb1fed3883aea3b2027e369af.zip
Merge pull request #9036 from baude/composelog
Set log driver for compatibility containers
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/containers.go10
-rw-r--r--pkg/specgen/generate/container.go8
2 files changed, 18 insertions, 0 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index 438fda441..aa12afc82 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -327,6 +327,11 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON,
state.Running = true
}
+ // docker calls the configured state "created"
+ if state.Status == define.ContainerStateConfigured.String() {
+ state.Status = define.ContainerStateCreated.String()
+ }
+
formatCapabilities(inspect.HostConfig.CapDrop)
formatCapabilities(inspect.HostConfig.CapAdd)
@@ -338,6 +343,11 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON,
if err := json.Unmarshal(h, &hc); err != nil {
return nil, err
}
+
+ // k8s-file == json-file
+ if hc.LogConfig.Type == define.KubernetesLogging {
+ hc.LogConfig.Type = define.JSONLogging
+ }
g, err := json.Marshal(inspect.GraphDriver)
if err != nil {
return nil, err
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index 2feb1d3b2..cc3f7928c 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -257,6 +257,14 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
}
}
+ if s.LogConfiguration == nil {
+ s.LogConfiguration = &specgen.LogConfig{}
+ }
+ // set log-driver from common if not already set
+ if len(s.LogConfiguration.Driver) < 1 {
+ s.LogConfiguration.Driver = rtc.Containers.LogDriver
+ }
+
warnings, err := verifyContainerResources(s)
if err != nil {
return warnings, err