summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorUrvashi Mohnani <umohnani@redhat.com>2021-11-15 10:05:42 -0500
committerMatthew Heon <mheon@redhat.com>2021-12-06 15:17:57 -0500
commit4a7af72ea95bd6ebba19db8d052527c5beb9c0eb (patch)
treedd39ddc6bd2c005e0b6f255451f4420b0c598767 /pkg/domain
parentca518ecdee6fba52e9e9a464a4915a4caaa3081b (diff)
downloadpodman-4a7af72ea95bd6ebba19db8d052527c5beb9c0eb.tar.gz
podman-4a7af72ea95bd6ebba19db8d052527c5beb9c0eb.tar.bz2
podman-4a7af72ea95bd6ebba19db8d052527c5beb9c0eb.zip
Add note about volume with unprivileged container
Add a note to the generated kube yaml if we detect a volume is being mounted. The note lets the user know what needs to be done to avoid permission denied error when trying to access the volume for an unprivileged container. Add the same note to the man pages. NO NEW TESTS NEEDED Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/infra/abi/generate.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/generate.go b/pkg/domain/infra/abi/generate.go
index a4d6bcf86..0defa1923 100644
--- a/pkg/domain/infra/abi/generate.go
+++ b/pkg/domain/infra/abi/generate.go
@@ -124,6 +124,14 @@ func (ic *ContainerEngine) GenerateKube(ctx context.Context, nameOrIDs []string,
if err != nil {
return nil, err
}
+ if len(po.Spec.Volumes) != 0 {
+ warning := `
+# NOTE: If you generated this yaml from an unprivileged and rootless podman container on an SELinux
+# enabled system, check the podman generate kube man page for steps to follow to ensure that your pod/container
+# has the right permissions to access the volumes added.
+`
+ content = append(content, []byte(warning))
+ }
b, err := generateKubeYAML(libpod.ConvertV1PodToYAMLPod(po))
if err != nil {
return nil, err