Skip to content

Commit 13efcd0

Browse files
authored
Add label selectors for catalog selection (#1137)
Signed-off-by: Todd Short <[email protected]>
1 parent 94ae951 commit 13efcd0

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

api/v1alpha1/clusterextension_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ type ClusterExtensionSpec struct {
6464
// Channel constraint definition
6565
Channel string `json:"channel,omitempty"`
6666

67+
//+kubebuilder:optional
68+
// +optional
69+
// CatalogSelector by label
70+
CatalogSelector metav1.LabelSelector `json:"catalogSelector,omitempty"`
71+
6772
//+kubebuilder:validation:Enum:=Enforce;Ignore
6873
//+kubebuilder:default:=Enforce
6974
//+kubebuilder:Optional

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,52 @@ spec:
3939
spec:
4040
description: ClusterExtensionSpec defines the desired state of ClusterExtension
4141
properties:
42+
catalogSelector:
43+
description: CatalogSelector by label
44+
properties:
45+
matchExpressions:
46+
description: matchExpressions is a list of label selector requirements.
47+
The requirements are ANDed.
48+
items:
49+
description: |-
50+
A label selector requirement is a selector that contains values, a key, and an operator that
51+
relates the key and values.
52+
properties:
53+
key:
54+
description: key is the label key that the selector applies
55+
to.
56+
type: string
57+
operator:
58+
description: |-
59+
operator represents a key's relationship to a set of values.
60+
Valid operators are In, NotIn, Exists and DoesNotExist.
61+
type: string
62+
values:
63+
description: |-
64+
values is an array of string values. If the operator is In or NotIn,
65+
the values array must be non-empty. If the operator is Exists or DoesNotExist,
66+
the values array must be empty. This array is replaced during a strategic
67+
merge patch.
68+
items:
69+
type: string
70+
type: array
71+
x-kubernetes-list-type: atomic
72+
required:
73+
- key
74+
- operator
75+
type: object
76+
type: array
77+
x-kubernetes-list-type: atomic
78+
matchLabels:
79+
additionalProperties:
80+
type: string
81+
description: |-
82+
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
83+
map is equivalent to an element of matchExpressions, whose key field is "key", the
84+
operator is "In", and the values array contains only "value". The requirements are ANDed.
85+
type: object
86+
type: object
87+
x-kubernetes-map-type: atomic
4288
channel:
4389
description: Channel constraint definition
4490
maxLength: 48

0 commit comments

Comments
 (0)