Skip to content

Commit

Permalink
feat: support multi receiver by matchLabels
Browse files Browse the repository at this point in the history
Signed-off-by: Raffael Sahli <[email protected]>
  • Loading branch information
raffis committed Mar 20, 2023
1 parent b841b2d commit 57f62f4
Show file tree
Hide file tree
Showing 6 changed files with 492 additions and 47 deletions.
2 changes: 2 additions & 0 deletions api/v1beta2/reference_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type CrossNamespaceObjectReference struct {
Kind string `json:"kind,omitempty"`

// Name of the referent.
// If multiple resources are targeted `*` may be set.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=53
// +required
Expand All @@ -44,6 +45,7 @@ type CrossNamespaceObjectReference struct {
// 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.
// MatchLabels requires the name to be set to `*`.
// +optional
MatchLabels map[string]string `json:"matchLabels,omitempty"`
}
5 changes: 3 additions & 2 deletions config/crd/bases/notification.toolkit.fluxcd.io_alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,11 @@ spec:
{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.
are ANDed. MatchLabels requires the name to be set to `*`.
type: object
name:
description: Name of the referent.
description: Name of the referent. If multiple resources are
targeted `*` may be set.
maxLength: 53
minLength: 1
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,11 @@ spec:
{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.
are ANDed. MatchLabels requires the name to be set to `*`.
type: object
name:
description: Name of the referent.
description: Name of the referent. If multiple resources are
targeted `*` may be set.
maxLength: 53
minLength: 1
type: string
Expand Down
6 changes: 4 additions & 2 deletions docs/api/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,8 @@ string
</em>
</td>
<td>
<p>Name of the referent.</p>
<p>Name of the referent.
If multiple resources are targeted <code>*</code> may be set.</p>
</td>
</tr>
<tr>
Expand All @@ -767,7 +768,8 @@ map[string]string
<em>(Optional)</em>
<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
operator is &ldquo;In&rdquo;, and the values array contains only &ldquo;value&rdquo;. The requirements are ANDed.</p>
operator is &ldquo;In&rdquo;, and the values array contains only &ldquo;value&rdquo;. The requirements are ANDed.
MatchLabels requires the name to be set to <code>*</code>.</p>
</td>
</tr>
</tbody>
Expand Down
Loading

0 comments on commit 57f62f4

Please sign in to comment.