Skip to content

Commit

Permalink
Add label selectors for catalog selection (#1137)
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Short <[email protected]>
  • Loading branch information
tmshort authored Aug 19, 2024
1 parent 94ae951 commit 13efcd0
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/v1alpha1/clusterextension_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ type ClusterExtensionSpec struct {
// Channel constraint definition
Channel string `json:"channel,omitempty"`

//+kubebuilder:optional
// +optional
// CatalogSelector by label
CatalogSelector metav1.LabelSelector `json:"catalogSelector,omitempty"`

//+kubebuilder:validation:Enum:=Enforce;Ignore
//+kubebuilder:default:=Enforce
//+kubebuilder:Optional
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,52 @@ spec:
spec:
description: ClusterExtensionSpec defines the desired state of ClusterExtension
properties:
catalogSelector:
description: CatalogSelector by label
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
channel:
description: Channel constraint definition
maxLength: 48
Expand Down

0 comments on commit 13efcd0

Please sign in to comment.