diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-21 13:56:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-21 13:56:17 -0500 |
commit | 469c2031fc1529ff81e1d8d9f05099ddca265174 (patch) | |
tree | 1fea8ee0e6c20a2be0da81f6f0413d7ce2bd2415 /cmd | |
parent | ac4ccdc3f17d6161b61831af231120748dd46982 (diff) | |
parent | 22d2caeeb1acadaced47bbacccec5f597e0d99f4 (diff) | |
download | podman-469c2031fc1529ff81e1d8d9f05099ddca265174.tar.gz podman-469c2031fc1529ff81e1d8d9f05099ddca265174.tar.bz2 podman-469c2031fc1529ff81e1d8d9f05099ddca265174.zip |
Merge pull request #9055 from baude/v3backportcomposelog
[3.0] Set log driver for compatability containers
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/common/create.go | 2 | ||||
-rw-r--r-- | cmd/podman/common/create_opts.go | 7 | ||||
-rw-r--r-- | cmd/podman/common/specgen.go | 2 |
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 } |