mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
podman play kube apply correct log driver
The --log-driver flag was silently ignored by podman play kube. This regression got introduced during the play kube rework. Unfortunately the test for this was skipped for no good reason. Fixes #10015 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
This commit is contained in:
@ -300,6 +300,7 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
|
||||
RestartPolicy: ctrRestartPolicy,
|
||||
NetNSIsHost: p.NetNS.IsHost(),
|
||||
SecretsManager: secretsManager,
|
||||
LogDriver: options.LogDriver,
|
||||
}
|
||||
specGen, err := kube.ToSpecGen(ctx, &specgenOpts)
|
||||
if err != nil {
|
||||
|
@ -98,6 +98,8 @@ type CtrSpecGenOptions struct {
|
||||
NetNSIsHost bool
|
||||
// SecretManager to access the secrets
|
||||
SecretsManager *secrets.SecretsManager
|
||||
// LogDriver which should be used for the container
|
||||
LogDriver string
|
||||
}
|
||||
|
||||
func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGenerator, error) {
|
||||
@ -115,6 +117,10 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener
|
||||
|
||||
s.Pod = opts.PodID
|
||||
|
||||
s.LogConfiguration = &specgen.LogConfig{
|
||||
Driver: opts.LogDriver,
|
||||
}
|
||||
|
||||
setupSecurityContext(s, opts.Container)
|
||||
|
||||
// Since we prefix the container name with pod name to work-around the uniqueness requirement,
|
||||
|
@ -1970,7 +1970,6 @@ MemoryReservation: {{ .HostConfig.MemoryReservation }}`})
|
||||
})
|
||||
|
||||
It("podman play kube applies log driver to containers", func() {
|
||||
Skip("need to verify images have correct packages for journald")
|
||||
pod := getPod()
|
||||
err := generateKubeYaml("pod", pod, kubeYaml)
|
||||
Expect(err).To(BeNil())
|
||||
|
Reference in New Issue
Block a user