tests: Refactor agnhost image pod usage - common (part 1)

A previous commit added  a few agnhost related functions that creates agnhost
pods / containers for general purposes.

Refactors tests to use those functions.
This commit is contained in:
Claudiu Belu
2019-12-17 17:22:46 +02:00
parent 131f42d263
commit c99b18580d
5 changed files with 94 additions and 263 deletions

View File

@@ -241,3 +241,14 @@ func getFileModeRegex(filePath string, mask *int32) string {
return fmt.Sprintf("(%s|%s)", linuxOutput, windowsOutput)
}
// createMounts creates a v1.VolumeMount list with a single element.
func createMounts(volumeName, volumeMountPath string, readOnly bool) []v1.VolumeMount {
return []v1.VolumeMount{
{
Name: volumeName,
MountPath: volumeMountPath,
ReadOnly: readOnly,
},
}
}