@@ -455,11 +455,13 @@ func (j *PVCTestJig) NewPodForCSI(name string, namespace string, claimName strin
455455
456456// NewPodForCSIFSSWrite returns the CSI Fss template for this jig,
457457// creates the Pod. Attaches PVC to the Pod which is created by CSI Fss. It does not have a node selector unlike the default pod template.
458- func (j * PVCTestJig ) NewPodForCSIFSSWrite (name string , namespace string , claimName string , fileName string ) string {
458+ func (j * PVCTestJig ) NewPodForCSIFSSWrite (name string , namespace string , claimName string , fileName string , encryptionEnabled bool ) string {
459459 By ("Creating a pod with the claiming PVC created by CSI" )
460460
461461 nodeSelectorMap := make (map [string ]string )
462- nodeSelectorMap ["oke.oraclecloud.com/e2e.oci-fss-util" ] = "installed"
462+ if encryptionEnabled {
463+ nodeSelectorMap ["oke.oraclecloud.com/e2e.oci-fss-util" ] = "installed"
464+ }
463465 command := fmt .Sprintf ("while true; do echo %s >> /data/%s; sleep 5; done" , name , fileName )
464466 pod , err := j .KubeClient .CoreV1 ().Pods (namespace ).Create (context .Background (), & v1.Pod {
465467 TypeMeta : metav1.TypeMeta {
@@ -514,11 +516,13 @@ func (j *PVCTestJig) NewPodForCSIFSSWrite(name string, namespace string, claimNa
514516// NewPodForCSIFSSRead returns the CSI Fss read pod template for this jig,
515517// creates the Pod. Attaches PVC to the Pod which is created by CSI Fss. It does not have a node selector unlike the default pod template.
516518// It does a grep on the file with string matchString and goes to completion with an exit code either 0 or 1.
517- func (j * PVCTestJig ) NewPodForCSIFSSRead (matchString string , namespace string , claimName string , fileName string ) {
519+ func (j * PVCTestJig ) NewPodForCSIFSSRead (matchString string , namespace string , claimName string , fileName string , encryptionEnabled bool ) {
518520 By ("Creating a pod with the claiming PVC created by CSI" )
519521
520522 nodeSelectorMap := make (map [string ]string )
521- nodeSelectorMap ["oke.oraclecloud.com/e2e.oci-fss-util" ] = "installed"
523+ if encryptionEnabled {
524+ nodeSelectorMap ["oke.oraclecloud.com/e2e.oci-fss-util" ] = "installed"
525+ }
522526 command := fmt .Sprintf ("grep -q -i %s /data/%s; exit $?" , matchString , fileName )
523527 pod , err := j .KubeClient .CoreV1 ().Pods (namespace ).Create (context .Background (), & v1.Pod {
524528 TypeMeta : metav1.TypeMeta {
@@ -832,7 +836,7 @@ func (j *PVCTestJig) CheckSinglePodReadWrite(namespace string, pvcName string, c
832836 By ("Creating Pod that can create and write to the file" )
833837 uid := uuid .NewUUID ()
834838 fileName := fmt .Sprintf ("out_%s.txt" , uid )
835- podName := j .NewPodForCSIFSSWrite (string (uid ), namespace , pvcName , fileName )
839+ podName := j .NewPodForCSIFSSWrite (string (uid ), namespace , pvcName , fileName , checkEncryption )
836840 time .Sleep (30 * time .Second ) //waiting for pod to become up and running
837841
838842 if checkEncryption {
@@ -844,15 +848,15 @@ func (j *PVCTestJig) CheckSinglePodReadWrite(namespace string, pvcName string, c
844848 j .checkFileExists (namespace , podName , "/data" , fileName )
845849
846850 By ("Creating Pod that can read contents of existing file" )
847- j .NewPodForCSIFSSRead (string (uid ), namespace , pvcName , fileName )
851+ j .NewPodForCSIFSSRead (string (uid ), namespace , pvcName , fileName , checkEncryption )
848852}
849853
850854func (j * PVCTestJig ) CheckMultiplePodReadWrite (namespace string , pvcName string , checkEncryption bool ) {
851855 uid := uuid .NewUUID ()
852856 fileName := fmt .Sprintf ("out_%s.txt" , uid )
853857 By ("Creating Pod that can create and write to the file" )
854858 uuid1 := uuid .NewUUID ()
855- podName1 := j .NewPodForCSIFSSWrite (string (uuid1 ), namespace , pvcName , fileName )
859+ podName1 := j .NewPodForCSIFSSWrite (string (uuid1 ), namespace , pvcName , fileName , checkEncryption )
856860 time .Sleep (30 * time .Second ) //waiting for pod to become up and running
857861
858862 By ("check if the file exists" )
@@ -865,7 +869,7 @@ func (j *PVCTestJig) CheckMultiplePodReadWrite(namespace string, pvcName string,
865869
866870 By ("Creating Pod that can create and write to the file" )
867871 uuid2 := uuid .NewUUID ()
868- podName2 := j .NewPodForCSIFSSWrite (string (uuid2 ), namespace , pvcName , fileName )
872+ podName2 := j .NewPodForCSIFSSWrite (string (uuid2 ), namespace , pvcName , fileName , checkEncryption )
869873 time .Sleep (30 * time .Second ) //waiting for pod to become up and running
870874
871875 if checkEncryption {
@@ -874,10 +878,10 @@ func (j *PVCTestJig) CheckMultiplePodReadWrite(namespace string, pvcName string,
874878 }
875879
876880 By ("Creating Pod that can read contents of existing file" )
877- j .NewPodForCSIFSSRead (string (uuid1 ), namespace , pvcName , fileName )
881+ j .NewPodForCSIFSSRead (string (uuid1 ), namespace , pvcName , fileName , checkEncryption )
878882
879883 By ("Creating Pod that can read contents of existing file" )
880- j .NewPodForCSIFSSRead (string (uuid2 ), namespace , pvcName , fileName )
884+ j .NewPodForCSIFSSRead (string (uuid2 ), namespace , pvcName , fileName , checkEncryption )
881885}
882886
883887func (j * PVCTestJig ) CheckDataPersistenceWithDeployment (pvcName string , ns string ){
0 commit comments