Documentation
¶
Index ¶
- Constants
- func AttributeWithSCFallback(pv *v1.PersistentVolume, sc *storagev1.StorageClass, key, defaultVal string) string
- func IsProfile(sc *storagev1.StorageClass) bool
- func ParseNonNegativeIntegerFromString(val string) (int64, error)
- func ParseOverrideStatus(pv *v1.PersistentVolume) (int64, int64, error)
- func PvAnnotationIntersection(pv *corev1.PersistentVolume, annotations []string) []string
- func ValidateStorageProfilesOverrideStatus(pv *corev1.PersistentVolume) error
Constants ¶
const ( // Annotation keys AnnotationPrefix = "gke-gcsfuse" AnnotationStatus = AnnotationPrefix + "/bucket-scan-status" AnnotationNumObjects = AnnotationPrefix + "/bucket-scan-num-objects" AnnotationTotalSize = AnnotationPrefix + "/bucket-scan-total-size-bytes" AnnotationLastUpdatedTime = AnnotationPrefix + "/bucket-scan-last-updated-time" AnnotationLocationType = AnnotationPrefix + "/bucket-scan-location-type" AnnotationHNSEnabled = AnnotationPrefix + "/bucket-scan-hns-enabled" LabelProfile = AnnotationPrefix + "/profile" ScanOverride = "override" )
Variables ¶
This section is empty.
Functions ¶
func AttributeWithSCFallback ¶ added in v1.21.11
func AttributeWithSCFallback(pv *v1.PersistentVolume, sc *storagev1.StorageClass, key, defaultVal string) string
AttributeWithSCFallback gets the value of a PV VolumeAttribute, if set. Otherwise, it checks the StorageClass's Parameters field as fallback. If the value is still not found, it uses defaultVal as the return value.
func IsProfile ¶ added in v1.21.11
func IsProfile(sc *storagev1.StorageClass) bool
IsProfile returns true if the StorageClass has the identifying gke-gcsfuse/profile label set to true. Returns fals otherwise.
func ParseNonNegativeIntegerFromString ¶
parseNonNegativeIntegerFromString returns an error if the string fails to be parsed as an integer, or if the integer is negative.
func ParseOverrideStatus ¶
func ParseOverrideStatus(pv *v1.PersistentVolume) (int64, int64, error)
parseOverrideStatus checks that, if the override mode is set, the PV has the required annotations with valid format/types. Returns the required annotations (parsed) if valid, or returns an error otherwise.
func PvAnnotationIntersection ¶
func PvAnnotationIntersection(pv *corev1.PersistentVolume, annotations []string) []string
pvAnnotationIntersection returns the intersection of the provided annotation keys and the annotation keys found in the PV.
func ValidateStorageProfilesOverrideStatus ¶
func ValidateStorageProfilesOverrideStatus(pv *corev1.PersistentVolume) error
ValidateStorageProfilesOverrideStatus returns error for incorrect usage of profile override annotations
Types ¶
This section is empty.