Documentation ¶
Index ¶
- Constants
- Variables
- func AppendUnstructuredObjects(objs []*unstructured.Unstructured, newObjs ...*unstructured.Unstructured) []*unstructured.Unstructured
- func ClearRefObjectForDispatch(un *unstructured.Unstructured)
- func ConvertUnstructuredsToReferredObjects(uns []*unstructured.Unstructured) (refObjs []common.ReferredObject, err error)
- func GetGroupVersionKindFromRefObjectSelector(mapper meta.RESTMapper, selector v1alpha1.ObjectReferrer) (schema.GroupVersionKind, error)
- func GetLabelSelectorFromRefObjectSelector(selector v1alpha1.ObjectReferrer) map[string]string
- func ReferredObjectsDelegatingClient(cli client.Client, objs []*unstructured.Unstructured) client.Client
- func SelectRefObjectsForDispatch(ctx context.Context, cli client.Client, appNs string, compName string, ...) (objs []*unstructured.Unstructured, err error)
- func ValidateRefObjectSelector(selector v1alpha1.ObjectReferrer) error
Constants ¶
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 ¶
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.