diff options
author | Andy Librian <andylibrian@gmail.com> | 2020-11-07 12:44:30 +0700 |
---|---|---|
committer | Andy Librian <andylibrian@gmail.com> | 2020-11-08 08:59:18 +0700 |
commit | f3355d9697119a1fd44abea1981d5ab6337ab67a (patch) | |
tree | e26da379377ab005f65e656f5f78856d5f2efd7a /pkg/domain/infra | |
parent | e2b82e6245ed9459a37dc004a2b1d593d2835cb7 (diff) | |
download | podman-f3355d9697119a1fd44abea1981d5ab6337ab67a.tar.gz podman-f3355d9697119a1fd44abea1981d5ab6337ab67a.tar.bz2 podman-f3355d9697119a1fd44abea1981d5ab6337ab67a.zip |
Add --log-driver to play kube
addresses #6604
Signed-off-by: Andy Librian <andylibrian@gmail.com>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r-- | pkg/domain/infra/abi/play.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index fbba00984..317eac6d5 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -351,7 +351,8 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY if err != nil { return nil, err } - conf, err := kubeContainerToCreateConfig(ctx, container, newImage, namespaces, volumes, pod.ID(), podName, podInfraID, configMaps, seccompPaths) + + conf, err := kubeContainerToCreateConfig(ctx, container, newImage, namespaces, volumes, pod.ID(), podName, podInfraID, configMaps, seccompPaths, options.LogDriver) if err != nil { return nil, err } @@ -464,7 +465,7 @@ func setupSecurityContext(securityConfig *createconfig.SecurityConfig, userConfi } // kubeContainerToCreateConfig takes a v1.Container and returns a createconfig describing a container -func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container, newImage *image.Image, namespaces map[string]string, volumes map[string]string, podID, podName, infraID string, configMaps []v1.ConfigMap, seccompPaths *kubeSeccompPaths) (*createconfig.CreateConfig, error) { +func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container, newImage *image.Image, namespaces map[string]string, volumes map[string]string, podID, podName, infraID string, configMaps []v1.ConfigMap, seccompPaths *kubeSeccompPaths, logDriver string) (*createconfig.CreateConfig, error) { var ( containerConfig createconfig.CreateConfig pidConfig createconfig.PidConfig @@ -593,6 +594,10 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container containerConfig.User = userConfig containerConfig.Security = securityConfig + if logDriver != "" { + containerConfig.LogDriver = logDriver + } + annotations := make(map[string]string) if infraID != "" { annotations[ann.SandboxID] = infraID |