Skip to content

Commit 4dd7049

Browse files
authored
Merge pull request #565 from matheuscscp/lift-url-validation
Lift HTTP/S validation from Provider spec.address
2 parents c6b8362 + 13d3d8f commit 4dd7049

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

api/v1beta2/provider_types.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ type ProviderSpec struct {
7474
// +optional
7575
Username string `json:"username,omitempty"`
7676

77-
// Address specifies the HTTP/S incoming webhook address of this Provider.
78-
// +kubebuilder:validation:Pattern="^(http|https)://.*$"
77+
// Address specifies the endpoint, in a generic sense, to where alerts are sent.
78+
// What kind of endpoint depends on the specific Provider type being used.
79+
// For the generic Provider, for example, this is an HTTP/S address.
80+
// For other Provider types this could be a project ID or a namespace.
7981
// +kubebuilder:validation:MaxLength:=2048
8082
// +kubebuilder:validation:Optional
8183
// +optional

config/crd/bases/notification.toolkit.fluxcd.io_providers.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,12 @@ spec:
228228
description: ProviderSpec defines the desired state of the Provider.
229229
properties:
230230
address:
231-
description: Address specifies the HTTP/S incoming webhook address
232-
of this Provider.
231+
description: Address specifies the endpoint, in a generic sense, to
232+
where alerts are sent. What kind of endpoint depends on the specific
233+
Provider type being used. For the generic Provider, for example,
234+
this is an HTTP/S address. For other Provider types this could be
235+
a project ID or a namespace.
233236
maxLength: 2048
234-
pattern: ^(http|https)://.*$
235237
type: string
236238
certSecretRef:
237239
description: CertSecretRef specifies the Secret containing a PEM-encoded

docs/api/v1beta2/notification.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,10 @@ string
313313
</td>
314314
<td>
315315
<em>(Optional)</em>
316-
<p>Address specifies the HTTP/S incoming webhook address of this Provider.</p>
316+
<p>Address specifies the endpoint, in a generic sense, to where alerts are sent.
317+
What kind of endpoint depends on the specific Provider type being used.
318+
For the generic Provider, for example, this is an HTTP/S address.
319+
For other Provider types this could be a project ID or a namespace.</p>
317320
</td>
318321
</tr>
319322
<tr>
@@ -902,7 +905,10 @@ string
902905
</td>
903906
<td>
904907
<em>(Optional)</em>
905-
<p>Address specifies the HTTP/S incoming webhook address of this Provider.</p>
908+
<p>Address specifies the endpoint, in a generic sense, to where alerts are sent.
909+
What kind of endpoint depends on the specific Provider type being used.
910+
For the generic Provider, for example, this is an HTTP/S address.
911+
For other Provider types this could be a project ID or a namespace.</p>
906912
</td>
907913
</tr>
908914
<tr>

docs/spec/v1beta2/providers.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,10 @@ stringData:
936936

937937
### Address
938938

939-
`.spec.address` is an optional field that specifies the URL where the events are posted.
939+
`.spec.address` is an optional field that specifies the endpoint where the events are posted.
940+
The meaning of endpoint here depends on the specific Provider type being used.
941+
For the `generic` Provider for example this is an HTTP/S address.
942+
For other Provider types this could be a project ID or a namespace.
940943

941944
If the address contains sensitive information such as tokens or passwords, it is
942945
recommended to store the address in the Kubernetes secret referenced by `.spec.secretRef.name`.

0 commit comments

Comments
 (0)