Return deprecation warning for storageOS,PhotonPD,ScaleIO..etc
Thes plugins are deprecated in earlier version of Kubernetes, however the PVspec was not validated and provided enough warning that, these are deprecated plugins. This commit add the warning and unit tests for the same. Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>
This commit is contained in:
@@ -83,6 +83,18 @@ func warningsForPersistentVolumeSpecAndMeta(fieldPath *field.Path, pvSpec *api.P
|
||||
if pvSpec.CephFS != nil {
|
||||
warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.28, non-functional in v1.31+", fieldPath.Child("spec", "persistentVolumeSource").Child("cephfs")))
|
||||
}
|
||||
if pvSpec.PhotonPersistentDisk != nil {
|
||||
warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.11, non-functional in v1.16+", fieldPath.Child("spec", "persistentVolumeSource").Child("photonPersistentDisk")))
|
||||
}
|
||||
if pvSpec.ScaleIO != nil {
|
||||
warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.16, non-functional in v1.22+", fieldPath.Child("spec", "persistentVolumeSource").Child("scaleIO")))
|
||||
}
|
||||
if pvSpec.StorageOS != nil {
|
||||
warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.22, non-functional in v1.25+", fieldPath.Child("spec", "persistentVolumeSource").Child("storageOS")))
|
||||
}
|
||||
if pvSpec.Glusterfs != nil {
|
||||
warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.25, non-functional in v1.26+", fieldPath.Child("spec", "persistentVolumeSource").Child("glusterfs")))
|
||||
}
|
||||
|
||||
return warnings
|
||||
}
|
||||
|
Reference in New Issue
Block a user