@@ -175,14 +175,32 @@ spec:
175175 properties :
176176 exclude :
177177 description : |-
178- Exclude contains an array of label selectors that target secrets .
179- If a secret matches the selector in any of the elements in the array, it is
178+ Exclude contains an array of resource selectors that target resources .
179+ If a resource matches the selector in any of the elements in the array, it is
180180 hidden from the user, regardless of the matches in the include array.
181181 items :
182182 description : |-
183- A label selector is a label query over a set of resources. The result of matchLabels and
184- matchExpressions are ANDed. An empty label selector matches all objects. A null
185- label selector matches no objects.
183+ CozystackResourceDefinitionResourceSelector extends metav1.LabelSelector with resourceNames support.
184+ A resource matches this selector only if it satisfies ALL criteria:
185+ - Label selector conditions (matchExpressions and matchLabels)
186+ - AND has a name that matches one of the names in resourceNames (if specified)
187+
188+ The resourceNames field supports Go templates with the following variables available:
189+ - {{ .name }}: The name of the managing application (from apps.cozystack.io/application.name)
190+ - {{ .kind }}: The lowercased kind of the managing application (from apps.cozystack.io/application.kind)
191+
192+ Example YAML:
193+ secrets:
194+ include:
195+ - matchExpressions:
196+ - key: badlabel
197+ operator: DoesNotExist
198+ matchLabels:
199+ goodlabel: goodvalue
200+ resourceNames:
201+ - "{{ .name }}-secret"
202+ - "{{ .kind }}-{{ .name }}-tls"
203+ - "specificname"
186204 properties :
187205 matchExpressions :
188206 description : matchExpressions is a list of label selector
@@ -225,20 +243,45 @@ spec:
225243 map is equivalent to an element of matchExpressions, whose key field is "key", the
226244 operator is "In", and the values array contains only "value". The requirements are ANDed.
227245 type : object
246+ resourceNames :
247+ description : |-
248+ ResourceNames is a list of resource names to match
249+ If specified, the resource must have one of these exact names to match the selector
250+ items :
251+ type : string
252+ type : array
228253 type : object
229254 x-kubernetes-map-type : atomic
230255 type : array
231256 include :
232257 description : |-
233- Include contains an array of label selectors that target secrets .
234- If a secret matches the selector in any of the elements in the array, and
235- matches none of the selectors in the exclude array that secret is marked
236- as a tenant secret and is visible to users.
258+ Include contains an array of resource selectors that target resources .
259+ If a resource matches the selector in any of the elements in the array, and
260+ matches none of the selectors in the exclude array that resource is marked
261+ as a tenant resource and is visible to users.
237262 items :
238263 description : |-
239- A label selector is a label query over a set of resources. The result of matchLabels and
240- matchExpressions are ANDed. An empty label selector matches all objects. A null
241- label selector matches no objects.
264+ CozystackResourceDefinitionResourceSelector extends metav1.LabelSelector with resourceNames support.
265+ A resource matches this selector only if it satisfies ALL criteria:
266+ - Label selector conditions (matchExpressions and matchLabels)
267+ - AND has a name that matches one of the names in resourceNames (if specified)
268+
269+ The resourceNames field supports Go templates with the following variables available:
270+ - {{ .name }}: The name of the managing application (from apps.cozystack.io/application.name)
271+ - {{ .kind }}: The lowercased kind of the managing application (from apps.cozystack.io/application.kind)
272+
273+ Example YAML:
274+ secrets:
275+ include:
276+ - matchExpressions:
277+ - key: badlabel
278+ operator: DoesNotExist
279+ matchLabels:
280+ goodlabel: goodvalue
281+ resourceNames:
282+ - "{{ .name }}-secret"
283+ - "{{ .kind }}-{{ .name }}-tls"
284+ - "specificname"
242285 properties :
243286 matchExpressions :
244287 description : matchExpressions is a list of label selector
@@ -281,6 +324,13 @@ spec:
281324 map is equivalent to an element of matchExpressions, whose key field is "key", the
282325 operator is "In", and the values array contains only "value". The requirements are ANDed.
283326 type : object
327+ resourceNames :
328+ description : |-
329+ ResourceNames is a list of resource names to match
330+ If specified, the resource must have one of these exact names to match the selector
331+ items :
332+ type : string
333+ type : array
284334 type : object
285335 x-kubernetes-map-type : atomic
286336 type : array
0 commit comments