topology

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL