Documentation ¶
Index ¶
- func GetGVRFromGVK(apiVersion, kind string) (schema.GroupVersionResource, error)
- func GetNestedValue(obj unstructured.Unstructured, criteria string) (interface{}, error)
- func IsMapSubset[K, V comparable](m, sub map[K]V) bool
- func JSONPathMatch(source, target unstructured.Unstructured, criteriaSet []map[string]string) (bool, error)
- func LabelSelectorsMatch(selectorObj, selectedObj unstructured.Unstructured, selectorPath string) (bool, error)
- func OwnerReferencesMatch(parent, child unstructured.Unstructured) (bool, error)
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGVRFromGVK ¶
func GetGVRFromGVK(apiVersion, kind string) (schema.GroupVersionResource, error)
GetGVRFromGVK retrieves the GroupVersionResource for a given API version and kind.
func GetNestedValue ¶
func GetNestedValue(obj unstructured.Unstructured, criteria string) (interface{}, error)
GetNestedValue returns nested value from the JSONPath obj.criteria
func IsMapSubset ¶
func IsMapSubset[K, V comparable](m, sub map[K]V) bool
IsMapSubset returns true if sub is a subnet of m
func JSONPathMatch ¶
func JSONPathMatch(source, target unstructured.Unstructured, criteriaSet []map[string]string) (bool, error)
JSONPathMatch returns true if source.criteriaKey(name/namespace) matches target.criteriaValue(JSONPath) criteriaSet contains a list of map from criteriaKey to criteriaValue Returns true if either map returns a full match based on length of the map
func LabelSelectorsMatch ¶
func LabelSelectorsMatch(selectorObj, selectedObj unstructured.Unstructured, selectorPath string) (bool, error)
LabelSelectorsMatch returns true if the labels set in selectorPath in the selectorObj can select selectedObj
func OwnerReferencesMatch ¶
func OwnerReferencesMatch(parent, child unstructured.Unstructured) (bool, error)
OwnerReferencesMatch returns true if parent is in the child's ownerReferences field
Types ¶
type Scope ¶
type Scope struct {
Scope meta.RESTScopeName
}
func (Scope) Name ¶
func (s Scope) Name() meta.RESTScopeName
Click to show internal directories.
Click to hide internal directories.