mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-07-19 14:32:36 +00:00
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
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user