Documentation
¶
Index ¶
- func ApplyFilter(obj *unstructured.Unstructured) (go_hook.FilterResult, error)
- func DeleteChangedObjects[T interface{ ... }](input *go_hook.HookInput, objects []storagev1.StorageClass, desired []T, ...)
- func DeleteObjectsIf(input *go_hook.HookInput, objects []storagev1.StorageClass, ...)
- func ExcludeByAnchoredPatterns[T Namer](classes []T, patterns []string) ([]T, error)
- func MergeOverridingByName[T Namer](base, overrides []T) []T
- func NormalizeName(value string) string
- func SortByName[T Namer](classes []T)
- type Namer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFilter ¶ added in v1.78.0
func ApplyFilter(obj *unstructured.Unstructured) (go_hook.FilterResult, error)
ApplyFilter is a FilterFunc for a StorageClass binding.
func DeleteChangedObjects ¶ added in v1.78.0
func DeleteChangedObjects[T interface {
Namer
comparable
}](input *go_hook.HookInput, objects []storagev1.StorageClass, desired []T, objectToDesired func(storagev1.StorageClass) T)
DeleteChangedObjects deletes every StorageClass object that is still desired but whose parameters, as objectToDesired reads them back into an entry, differ from the desired entry with the same name. The templates then recreate it: StorageClass parameters are immutable. An object that is no longer desired is left alone.
func DeleteObjectsIf ¶ added in v1.78.0
func DeleteObjectsIf(input *go_hook.HookInput, objects []storagev1.StorageClass, shouldDeleteFunc func(storagev1.StorageClass) bool)
DeleteObjectsIf deletes every StorageClass object shouldDelete selects, so that the templates recreate the ones still wanted: most StorageClass fields are immutable.
func ExcludeByAnchoredPatterns ¶ added in v1.78.0
ExcludeByAnchoredPatterns returns the entries whose name matches none of the regular expressions. Every pattern is anchored as ^(pattern)$, so a plain name stays an exact name: `fast` excludes `fast` and not `ultra-fast-ssd`. The result is always a new slice.
func MergeOverridingByName ¶ added in v1.78.0
func MergeOverridingByName[T Namer](base, overrides []T) []T
MergeOverridingByName returns base with every entry replaced, in its place, by the override with exactly the same name; the remaining overrides are appended in their order. A name overrides lists more than once yields a single entry, the last one. Neither input is changed.
Names are compared exactly, not as patterns: provider class names are often prefixes of each other (network-ssd and network-ssd-nonreplicated).
func NormalizeName ¶ added in v1.78.0
NormalizeName turns a cloud-side name — a zVirt storage domain, a DVP storage class — into a name Kubernetes accepts for an object: a lowercase RFC 1123 subdomain.
See https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
func SortByName ¶ added in v1.78.0
func SortByName[T Namer](classes []T)
SortByName orders the entries by name in place, keeping the relative order of equal names.