Merge pull request #9978 from shubham-pampattiwar/fix/image-volume-type-policy
Run the E2E test on kind / get-go-version (push) Failing after 1m6s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Successful in 10s
Main CI / Build (push) Failing after 40s

Add image volume type support to volume policies
This commit is contained in:
Shubham Pampattiwar
2026-07-08 21:31:50 -07:00
committed by GitHub
3 changed files with 14 additions and 0 deletions
@@ -0,0 +1 @@
Add image volume type support to volume policies
@@ -45,6 +45,7 @@ const (
Glusterfs SupportedVolume = "glusterfs"
GCEPersistentDisk SupportedVolume = "gcePersistentDisk"
HostPath SupportedVolume = "hostPath"
Image SupportedVolume = "image"
ISCSI SupportedVolume = "iscsi"
Local SupportedVolume = "local"
NFS SupportedVolume = "nfs"
@@ -243,5 +244,8 @@ func getVolumeTypeFromVolume(vol *corev1api.Volume) SupportedVolume {
if vol.EmptyDir != nil {
return EmptyDir
}
if vol.Image != nil {
return Image
}
return ""
}
@@ -563,6 +563,15 @@ func TestGetVolumeTypeFromVolume(t *testing.T) {
},
expected: Ephemeral,
},
{
name: "Test Image",
inputVol: &corev1api.Volume{
VolumeSource: corev1api.VolumeSource{
Image: &corev1api.ImageVolumeSource{},
},
},
expected: Image,
},
}
for _, tc := range testCases {