diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-11-10 12:29:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 12:29:19 +0000 |
commit | da95fb4226c82694af19610578d9c14a6aa964f2 (patch) | |
tree | 4619c8156df3d85b7d56ebc6e2c17dac1c829e19 /pkg/domain | |
parent | c20970f2b4de458afb631d3afdae30bfa0f686e5 (diff) | |
parent | f3355d9697119a1fd44abea1981d5ab6337ab67a (diff) | |
download | podman-da95fb4226c82694af19610578d9c14a6aa964f2.tar.gz podman-da95fb4226c82694af19610578d9c14a6aa964f2.tar.bz2 podman-da95fb4226c82694af19610578d9c14a6aa964f2.zip |
Merge pull request #8270 from andylibrian/log-driver-option-for-play-kube
Add --log-driver to play kube
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/entities/play.go | 2 | ||||
-rw-r--r-- | pkg/domain/infra/abi/play.go | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/pkg/domain/entities/play.go b/pkg/domain/entities/play.go index 356e6869d..7e4afcc28 100644 --- a/pkg/domain/entities/play.go +++ b/pkg/domain/entities/play.go @@ -26,6 +26,8 @@ type PlayKubeOptions struct { SeccompProfileRoot string // ConfigMaps - slice of pathnames to kubernetes configmap YAMLs. ConfigMaps []string + // LogDriver for the container. For example: journald + LogDriver string } // PlayKubePod represents a single pod and associated containers created by play kube 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 |