From 6d1d6cc0b20eeb96169d7ec5d10a152f765773e9 Mon Sep 17 00:00:00 2001 From: Niall Crowe Date: Fri, 29 Apr 2022 11:42:20 +0100 Subject: play kube default log driver The default log driver is not used when using play kube without --log-driver. The LogDriver function needs to be called in order to use the default log driver. fixes #13781 Signed-off-by: Niall Crowe --- cmd/podman/common/create.go | 2 +- cmd/podman/common/create_opts.go | 2 +- cmd/podman/play/kube.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index 1c1a7c3e3..d28becc8a 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -299,7 +299,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, logDriverFlagName := "log-driver" createFlags.StringVar( &cf.LogDriver, - logDriverFlagName, logDriver(), + 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 16f193b03..c40d1ea51 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -530,7 +530,7 @@ func volumes() []string { return nil } -func logDriver() string { +func LogDriver() string { if !registry.IsRemote() { return containerConfig.Containers.LogDriver } diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go index 40d14a609..3be7396ce 100644 --- a/cmd/podman/play/kube.go +++ b/cmd/podman/play/kube.go @@ -87,7 +87,7 @@ func init() { _ = kubeCmd.RegisterFlagCompletionFunc(staticIPFlagName, completion.AutocompleteNone) logDriverFlagName := "log-driver" - flags.StringVar(&kubeOptions.LogDriver, logDriverFlagName, "", "Logging driver for the container") + flags.StringVar(&kubeOptions.LogDriver, logDriverFlagName, common.LogDriver(), "Logging driver for the container") _ = kubeCmd.RegisterFlagCompletionFunc(logDriverFlagName, common.AutocompleteLogDriver) logOptFlagName := "log-opt" -- cgit v1.2.3-54-g00ecf