un-document receivers.spec.resources.matchLabels

This has been introduced in #482 but we actually want this feature to
only be available in v1 of the API. A follow-up PR will re-add this to
the v1 API.

Signed-off-by: Max Jonas Werner <mail@makk.es>
This commit is contained in:
Max Jonas Werner 2023-03-27 17:06:43 +02:00
parent f8ab99e080
commit e7c8c7b6a8
No known key found for this signature in database
GPG Key ID: EB525E0F02B52140
5 changed files with 7 additions and 40 deletions

View File

@ -29,7 +29,6 @@ type CrossNamespaceObjectReference struct {
Kind string `json:"kind,omitempty"` Kind string `json:"kind,omitempty"`
// Name of the referent. // Name of the referent.
// If multiple resources are targeted `*` may be set.
// +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=53 // +kubebuilder:validation:MaxLength=53
// +required // +required
@ -45,7 +44,6 @@ type CrossNamespaceObjectReference struct {
// MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels // 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 // 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. // operator is "In", and the values array contains only "value". The requirements are ANDed.
// MatchLabels requires the name to be set to `*`.
// +optional // +optional
MatchLabels map[string]string `json:"matchLabels,omitempty"` MatchLabels map[string]string `json:"matchLabels,omitempty"`
} }

View File

@ -279,11 +279,10 @@ spec:
{key,value} in the matchLabels map is equivalent to an element {key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements is "In", and the values array contains only "value". The requirements
are ANDed. MatchLabels requires the name to be set to `*`. are ANDed.
type: object type: object
name: name:
description: Name of the referent. If multiple resources are description: Name of the referent.
targeted `*` may be set.
maxLength: 53 maxLength: 53
minLength: 1 minLength: 1
type: string type: string

View File

@ -288,11 +288,10 @@ spec:
{key,value} in the matchLabels map is equivalent to an element {key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements is "In", and the values array contains only "value". The requirements
are ANDed. MatchLabels requires the name to be set to `*`. are ANDed.
type: object type: object
name: name:
description: Name of the referent. If multiple resources are description: Name of the referent.
targeted `*` may be set.
maxLength: 53 maxLength: 53
minLength: 1 minLength: 1
type: string type: string

View File

@ -741,8 +741,7 @@ string
</em> </em>
</td> </td>
<td> <td>
<p>Name of the referent. <p>Name of the referent.</p>
If multiple resources are targeted <code>*</code> may be set.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -768,8 +767,7 @@ map[string]string
<em>(Optional)</em> <em>(Optional)</em>
<p>MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels <p>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 &ldquo;key&rdquo;, the map is equivalent to an element of matchExpressions, whose key field is &ldquo;key&rdquo;, the
operator is &ldquo;In&rdquo;, and the values array contains only &ldquo;value&rdquo;. The requirements are ANDed. operator is &ldquo;In&rdquo;, and the values array contains only &ldquo;value&rdquo;. The requirements are ANDed.</p>
MatchLabels requires the name to be set to <code>*</code>.</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -635,36 +635,9 @@ A resource entry contains the following fields:
`GitRepository`, `Kustomization`, `HelmRelease`, `HelmChart`, `GitRepository`, `Kustomization`, `HelmRelease`, `HelmChart`,
`HelmRepository`, `ImageRepository`, `ImagePolicy`, `ImageUpdateAutomation` `HelmRepository`, `ImageRepository`, `ImagePolicy`, `ImageUpdateAutomation`
and `OCIRepository`. and `OCIRepository`.
- `name`: The Flux Custom Resource `.metadata.name` or it can be set to '*' wildcard(when `matchLabels` is specified) - `name`: The Flux Custom Resource `.metadata.name`.
- `namespace` (Optional): The Flux Custom Resource `.metadata.namespace`. - `namespace` (Optional): The Flux Custom Resource `.metadata.namespace`.
When not specified, the Receiver's `.metadata.namespace` is used instead. When not specified, the Receiver's `.metadata.namespace` is used instead.
- `matchLabels` (Optional): Annotate Flux Custom Resources with specific labels.
The `name` field must be set to '*' when using `matchLabels`
#### Annotate objects by name
To annotate single Flux object, set the `kind`, `name` and `namespace`:
```yaml
resources:
- apiVersion: image.toolkit.fluxcd.io/v1beta1
kind: ImageRepository
name: podinfo
```
#### Annotate objects by label
To annotate Flux objects of a particular kind with specific labels:
```yaml
resources:
- apiVersion: image.toolkit.fluxcd.io/v1beta1
kind: ImageRepository
name: "*"
matchLabels:
app: podinfo
```
**Note:** Cross-namespace references [can be disabled for security **Note:** Cross-namespace references [can be disabled for security
reasons](#disabling-cross-namespace-selectors). reasons](#disabling-cross-namespace-selectors).