summaryrefslogtreecommitdiff
path: root/cmd
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 /cmd
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 'cmd')
-rw-r--r--cmd/podman/common/create.go2
-rw-r--r--cmd/podman/common/create_opts.go7
-rw-r--r--cmd/podman/common/specgen.go2
3 files changed, 9 insertions, 2 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index 280175f95..17fba5427 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -402,7 +402,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *ContainerCLIOpts) {
logDriverFlagName := "log-driver"
createFlags.StringVar(
&cf.LogDriver,
- logDriverFlagName, "",
+ logDriverFlagName, logDriver(),
"Logging driver for the container",
)
_ = cmd.RegisterFlagCompletionFunc(logDriverFlagName, AutocompleteLogDriver)
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go
index 9635f4135..f252618ce 100644
--- a/cmd/podman/common/create_opts.go
+++ b/cmd/podman/common/create_opts.go
@@ -517,3 +517,10 @@ func volumes() []string {
}
return nil
}
+
+func logDriver() string {
+ if !registry.IsRemote() {
+ return containerConfig.Containers.LogDriver
+ }
+ return ""
+}
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 287836d9f..4cc53a630 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -463,7 +463,7 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
if s.LogConfiguration == nil {
s.LogConfiguration = &specgen.LogConfig{}
}
- s.LogConfiguration.Driver = define.KubernetesLogging
+
if ld := c.LogDriver; len(ld) > 0 {
s.LogConfiguration.Driver = ld
}