Merge pull request #136530 from saschagrunert/fix-image-volume-symlink-test

Fix image volume subPath test symlink issue
This commit is contained in:
Kubernetes Prow Robot 2026-02-03 02:18:34 +05:30 committed by GitHub
commit f7ca45a969
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,6 +31,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/kubelet/images"
"k8s.io/kubernetes/pkg/kubelet/kuberuntime"
"k8s.io/kubernetes/test/e2e/feature"
"k8s.io/kubernetes/test/e2e/framework"
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
@ -41,7 +42,7 @@ import (
// Run this single test locally using a running CRI-O instance by:
// make test-e2e-node CONTAINER_RUNTIME_ENDPOINT="unix:///var/run/crio/crio.sock" TEST_ARGS='--ginkgo.focus="ImageVolume" --feature-gates=ImageVolume=true --service-feature-gates=ImageVolume=true --kubelet-flags="--cgroup-root=/ --runtime-cgroups=/system.slice/crio.service --kubelet-cgroups=/system.slice/kubelet.service --fail-swap-on=false"'
var _ = SIGDescribe("ImageVolume", func() {
var _ = SIGDescribe("ImageVolume", feature.ImageVolume, func() {
f := framework.NewDefaultFramework("image-volume-test")
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
@ -329,8 +330,9 @@ var _ = SIGDescribe("ImageVolume", func() {
err := e2epod.WaitForPodNameRunningInNamespace(ctx, f.ClientSet, podName, f.Namespace.Name)
framework.ExpectNoError(err, "Failed to await for the pod to be running: (%s/%s)", f.Namespace.Name, podName)
fileContent := e2epod.ExecCommandInContainer(f, podName, containerName, "/bin/cat", filepath.Join(volumePathPrefix, "os-release"))
gomega.Expect(fileContent).To(gomega.ContainSubstring("Alpine Linux"))
// Using this file is intentional because it's generally available on Linux and will not expose any secret information.
fileContent := e2epod.ExecCommandInContainer(f, podName, containerName, "/bin/cat", filepath.Join(volumePathPrefix, "passwd"))
gomega.Expect(fileContent).To(gomega.ContainSubstring("root:"))
})
f.It("should fail if subPath in volume is not existing", func(ctx context.Context) {