volumeattributesclass and core api changes

This commit is contained in:
carlory
2023-10-31 10:12:02 +08:00
parent f5a5d83d7c
commit ae90a69677
28 changed files with 2171 additions and 84 deletions

View File

@@ -26,6 +26,9 @@ const IsDefaultStorageClassAnnotation = "storageclass.kubernetes.io/is-default-c
// TODO: remove Beta when no longer used
const BetaIsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
// AlphaIsDefaultVolumeAttributesClassAnnotation is the alpha version of IsDefaultVolumeAttributesClassAnnotation.
const AlphaIsDefaultVolumeAttributesClassAnnotation = "volumeattributesclass.alpha.kubernetes.io/is-default-class"
// IsDefaultAnnotation returns a boolean if
// the annotation is set
// TODO: remove Beta when no longer needed
@@ -39,3 +42,9 @@ func IsDefaultAnnotation(obj metav1.ObjectMeta) bool {
return false
}
// IsDefaultAnnotationForVolumeAttributesClass returns a boolean if
// the annotation is set
func IsDefaultAnnotationForVolumeAttributesClass(obj metav1.ObjectMeta) bool {
return obj.Annotations[AlphaIsDefaultVolumeAttributesClassAnnotation] == "true"
}