summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/domain/infra/abi/play.go1
-rw-r--r--pkg/specgen/generate/kube/kube.go6
-rwxr-xr-xtest/compose/test-compose8
-rw-r--r--test/e2e/play_kube_test.go1
4 files changed, 12 insertions, 4 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go
index 52f759f13..6eecef2de 100644
--- a/pkg/domain/infra/abi/play.go
+++ b/pkg/domain/infra/abi/play.go
@@ -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 {
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go
index 31ed3fd7c..7aeec9d41 100644
--- a/pkg/specgen/generate/kube/kube.go
+++ b/pkg/specgen/generate/kube/kube.go
@@ -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,
diff --git a/test/compose/test-compose b/test/compose/test-compose
index c4c484190..46ca80321 100755
--- a/test/compose/test-compose
+++ b/test/compose/test-compose
@@ -173,15 +173,16 @@ function test_port() {
if [ $curl_rc -ne 0 ]; then
_show_ok 0 "$testname - curl (port $port) failed with status $curl_rc"
- # FIXME: is this useful? What else can we do to diagnose?
- echo "# docker-compose logs:"
- docker-compose logs
echo "# podman ps -a:"
$PODMAN_BIN --root $WORKDIR/root --runroot $WORKDIR/runroot ps -a
if type -p ss; then
echo "# ss -tulpn:"
ss -tulpn
+ echo "# podman unshare --rootless-cni ss -tulpn:"
+ $PODMAN_BIN --root $WORKDIR/root --runroot $WORKDIR/runroot unshare --rootless-cni ss -tulpn
fi
+ echo "# cat $WORKDIR/server.log:"
+ cat $WORKDIR/server.log
return
fi
@@ -212,6 +213,7 @@ function start_service() {
cp /etc/cni/net.d/*podman*conflist $WORKDIR/cni/
$PODMAN_BIN \
+ --log-level debug \
--root $WORKDIR/root \
--runroot $WORKDIR/runroot \
--cgroup-manager=systemd \
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 41afd9f75..e479b88cc 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -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())