Documentation ¶
Index ¶
- Variables
- func IdentityMatchesWorkload(selectors []*commonv1.IdentitySelector, workload *discoveryv1.Workload) bool
- func SelectorMatchesDestination(selectors []*commonv1.DestinationSelector, ...) bool
- func SelectorMatchesObject(candidate ezkube.Object, selector *v1.ObjectSelector, ownerNamespace string) bool
- func SelectorMatchesWorkload(ctx context.Context, selectors []*commonv1.WorkloadSelector, ...) bool
- func ValidateSelector(selector *v1.ObjectSelector) error
- func WorkloadSelectorContainsCluster(selectors []*commonv1.WorkloadSelector, clusterName string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ObjectSelectorExpressionsAndLabelsWarning = eris.New("cannot use both labels and expressions within the " + "same selector") ObjectSelectorInvalidExpressionWarning = eris.New("the object selector expression is invalid") // Map connecting Objects expression operator values and Kubernetes expression operator string values. ObjectExpressionOperatorValues = map[v1.ObjectSelector_Expression_Operator]selection.Operator{ v1.ObjectSelector_Expression_Equals: selection.Equals, v1.ObjectSelector_Expression_DoubleEquals: selection.DoubleEquals, v1.ObjectSelector_Expression_NotEquals: selection.NotEquals, v1.ObjectSelector_Expression_In: selection.In, v1.ObjectSelector_Expression_NotIn: selection.NotIn, v1.ObjectSelector_Expression_Exists: selection.Exists, v1.ObjectSelector_Expression_DoesNotExist: selection.DoesNotExist, v1.ObjectSelector_Expression_GreaterThan: selection.GreaterThan, v1.ObjectSelector_Expression_LessThan: selection.LessThan, } )
Functions ¶
func IdentityMatchesWorkload ¶
func IdentityMatchesWorkload(selectors []*commonv1.IdentitySelector, workload *discoveryv1.Workload) bool
func SelectorMatchesDestination ¶ added in v1.1.0
func SelectorMatchesDestination(selectors []*commonv1.DestinationSelector, destination *discoveryv1.Destination) bool
func SelectorMatchesObject ¶ added in v1.1.0
func SelectorMatchesObject( candidate ezkube.Object, selector *v1.ObjectSelector, ownerNamespace string, ) bool
TODO: validate the logic contained here
func SelectorMatchesWorkload ¶
func SelectorMatchesWorkload(ctx context.Context, selectors []*commonv1.WorkloadSelector, workload *discoveryv1.Workload) bool
func ValidateSelector ¶ added in v1.1.0
func ValidateSelector( selector *v1.ObjectSelector, ) error
used in enterprise
func WorkloadSelectorContainsCluster ¶
func WorkloadSelectorContainsCluster(selectors []*commonv1.WorkloadSelector, clusterName string) bool
Return true if any WorkloadSelector selects the specified clusterName
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.