Unverified Commit 8e329f1c authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #68312 from msau42/fix-e2e

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md. Fix gce localssd pv tests **What this PR does / why we need it**: When running local PV tests against GCE local SSD, it directly uses the disk so doesn't need to create a tmp dir like the other test formats. Fsgroup tests do not create test-file so don't error on cleanup if the file doesn't exist. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #68308 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents 4bc9e94f 07ebe323
...@@ -940,7 +940,12 @@ func setupLocalVolumeGCELocalSSD(config *localTestConfig, node *v1.Node) *localT ...@@ -940,7 +940,12 @@ func setupLocalVolumeGCELocalSSD(config *localTestConfig, node *v1.Node) *localT
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
dirName := strings.Fields(res)[0] dirName := strings.Fields(res)[0]
hostDir := "/mnt/disks/by-uuid/google-local-ssds-scsi-fs/" + dirName hostDir := "/mnt/disks/by-uuid/google-local-ssds-scsi-fs/" + dirName
return generateLocalTestVolume(hostDir, config, GCELocalSSDVolumeType, node) // gce local ssd does not need to create a directory
return &localTestVolume{
node: node,
hostDir: hostDir,
localVolumeType: GCELocalSSDVolumeType,
}
} }
func setupLocalVolumeDirectory(config *localTestConfig, node *v1.Node) *localTestVolume { func setupLocalVolumeDirectory(config *localTestConfig, node *v1.Node) *localTestVolume {
...@@ -1108,7 +1113,8 @@ func verifyLocalPod(config *localTestConfig, volume *localTestVolume, pod *v1.Po ...@@ -1108,7 +1113,8 @@ func verifyLocalPod(config *localTestConfig, volume *localTestVolume, pod *v1.Po
// Deletes the PVC/PV, and launches a pod with hostpath volume to remove the test directory. // Deletes the PVC/PV, and launches a pod with hostpath volume to remove the test directory.
func cleanupLocalVolumeGCELocalSSD(config *localTestConfig, volume *localTestVolume) { func cleanupLocalVolumeGCELocalSSD(config *localTestConfig, volume *localTestVolume) {
By("Removing the test directory") By("Removing the test directory")
removeCmd := fmt.Sprintf("rm %s", volume.hostDir+"/"+testFile) file := volume.hostDir + "/" + testFile
removeCmd := fmt.Sprintf("if [ -f %s ]; then rm %s; fi", file, file)
err := issueNodeCommand(config, removeCmd, volume.node) err := issueNodeCommand(config, removeCmd, volume.node)
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment