component

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RefObjectsAvailableScopeGlobal ref-objects component can refer to arbitrary objects in any cluster
	RefObjectsAvailableScopeGlobal = "global"
	// RefObjectsAvailableScopeCluster ref-objects component can only refer to objects inside the hub cluster
	RefObjectsAvailableScopeCluster = "cluster"
	// RefObjectsAvailableScopeNamespace ref-objects component can only refer to objects inside the application namespace
	RefObjectsAvailableScopeNamespace = "namespace"
)

Variables

View Source
var RefObjectsAvailableScope = RefObjectsAvailableScopeGlobal

RefObjectsAvailableScope indicates the available scope for objects to refer

Functions

func AppendUnstructuredObjects

func AppendUnstructuredObjects(objs []*unstructured.Unstructured, newObjs ...*unstructured.Unstructured) []*unstructured.Unstructured

AppendUnstructuredObjects add new objects into object list if not exists

func ClearRefObjectForDispatch

func ClearRefObjectForDispatch(un *unstructured.Unstructured)

ClearRefObjectForDispatch reset the objects for dispatch

func ConvertUnstructuredsToReferredObjects

func ConvertUnstructuredsToReferredObjects(uns []*unstructured.Unstructured) (refObjs []common.ReferredObject, err error)

ConvertUnstructuredsToReferredObjects convert unstructured objects into ReferredObjects

func GetGroupVersionKindFromRefObjectSelector

func GetGroupVersionKindFromRefObjectSelector(mapper meta.RESTMapper, selector v1alpha1.ObjectReferrer) (schema.GroupVersionKind, error)

GetGroupVersionKindFromRefObjectSelector extract GroupVersionKind by Resource if provided, otherwise, extract from APIVersion and Kind directly

func GetLabelSelectorFromRefObjectSelector

func GetLabelSelectorFromRefObjectSelector(selector v1alpha1.ObjectReferrer) map[string]string

GetLabelSelectorFromRefObjectSelector extract labelSelector from `labelSelector` first. If empty, extract from `selector`

func ReferredObjectsDelegatingClient

func ReferredObjectsDelegatingClient(cli client.Client, objs []*unstructured.Unstructured) client.Client

ReferredObjectsDelegatingClient delegate client get/list function by retrieving ref-objects from existing objects

func SelectRefObjectsForDispatch

func SelectRefObjectsForDispatch(ctx context.Context, cli client.Client, appNs string, compName string, selector v1alpha1.ObjectReferrer) (objs []*unstructured.Unstructured, err error)

SelectRefObjectsForDispatch select objects by selector from kubernetes

func ValidateRefObjectSelector

func ValidateRefObjectSelector(selector v1alpha1.ObjectReferrer) error

ValidateRefObjectSelector validate if exclusive fields are set for the selector

Types

This section is empty.

Jump to

Keyboard shortcuts

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