Remove URL syntax validation for provider address entirely

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
This commit is contained in:
Matheus Pimenta 2023-12-12 19:00:30 +00:00
parent e48be82c89
commit 143a0b3ee0
2 changed files with 0 additions and 15 deletions

View File

@ -281,10 +281,6 @@ func createNotifier(ctx context.Context, kubeClient client.Client, provider apiv
return nil, "", fmt.Errorf("invalid address in secret: address exceeds maximum length of %d bytes", 2048)
}
webhook = string(address)
_, err := url.Parse(webhook)
if err != nil {
return nil, "", fmt.Errorf("invalid address in secret '%s': %w", webhook, err)
}
}
if p, ok := secret.Data["password"]; ok {

View File

@ -570,17 +570,6 @@ func TestCreateNotifier(t *testing.T) {
"headers": []byte(`foo: bar`),
},
},
{
name: "reference to secret with invalid address",
providerSpec: &apiv1beta3.ProviderSpec{
Type: "slack",
SecretRef: &meta.LocalObjectReference{Name: secretName},
},
secretData: map[string][]byte{
"address": []byte("https://example.com|"),
},
wantErr: true,
},
{
name: "reference to secret with invalid proxy",
providerSpec: &apiv1beta3.ProviderSpec{