@@ -465,7 +465,7 @@ func (m *mockDriverSetup) createPodWithFSGroup(ctx context.Context, fsGroup *int
465
465
return class , claim , pod
466
466
}
467
467
468
- func (m * mockDriverSetup ) createPodWithSELinux (ctx context.Context , accessModes []v1.PersistentVolumeAccessMode , mountOptions []string , seLinuxOpts * v1.SELinuxOptions ) (* storagev1.StorageClass , * v1.PersistentVolumeClaim , * v1.Pod ) {
468
+ func (m * mockDriverSetup ) createPodWithSELinux (ctx context.Context , accessModes []v1.PersistentVolumeAccessMode , mountOptions []string , seLinuxOpts * v1.SELinuxOptions , policy * v1. PodSELinuxChangePolicy ) (* storagev1.StorageClass , * v1.PersistentVolumeClaim , * v1.Pod ) {
469
469
ginkgo .By ("Creating pod with SELinux context" )
470
470
f := m .f
471
471
nodeSelection := m .config .ClientNodeSelection
@@ -482,7 +482,7 @@ func (m *mockDriverSetup) createPodWithSELinux(ctx context.Context, accessModes
482
482
ReclaimPolicy : m .tp .reclaimPolicy ,
483
483
}
484
484
class , claim := createClaim (ctx , f .ClientSet , scTest , nodeSelection , m .tp .scName , f .Namespace .Name , accessModes )
485
- pod , err := startPausePodWithSELinuxOptions (f .ClientSet , claim , nodeSelection , f .Namespace .Name , seLinuxOpts )
485
+ pod , err := startPausePodWithSELinuxOptions (f .ClientSet , claim , nodeSelection , f .Namespace .Name , seLinuxOpts , policy )
486
486
framework .ExpectNoError (err , "Failed to create pause pod with SELinux context %s: %v" , seLinuxOpts , err )
487
487
488
488
if class != nil {
@@ -804,14 +804,15 @@ func startBusyBoxPodWithVolumeSource(cs clientset.Interface, volumeSource v1.Vol
804
804
return cs .CoreV1 ().Pods (ns ).Create (context .TODO (), pod , metav1.CreateOptions {})
805
805
}
806
806
807
- func startPausePodWithSELinuxOptions (cs clientset.Interface , pvc * v1.PersistentVolumeClaim , node e2epod.NodeSelection , ns string , seLinuxOpts * v1.SELinuxOptions ) (* v1.Pod , error ) {
807
+ func startPausePodWithSELinuxOptions (cs clientset.Interface , pvc * v1.PersistentVolumeClaim , node e2epod.NodeSelection , ns string , seLinuxOpts * v1.SELinuxOptions , policy * v1. PodSELinuxChangePolicy ) (* v1.Pod , error ) {
808
808
pod := & v1.Pod {
809
809
ObjectMeta : metav1.ObjectMeta {
810
810
GenerateName : "pvc-volume-tester-" ,
811
811
},
812
812
Spec : v1.PodSpec {
813
813
SecurityContext : & v1.PodSecurityContext {
814
- SELinuxOptions : seLinuxOpts ,
814
+ SELinuxOptions : seLinuxOpts ,
815
+ SELinuxChangePolicy : policy ,
815
816
},
816
817
Containers : []v1.Container {
817
818
{
0 commit comments