1
0
mirror of https://github.com/coreos/prometheus-operator.git synced 2026-02-05 06:45:27 +01:00

Feat: Add validations to SNS Receiver in Alertmanager Config CR (#8217)

* api: update variable type

to match the type of optional and add more validation

* am-validation: add url validation and test case

to semantically verify URL

* alertmanager: move test case to operator

to validate at the correct part

* validation: update validation method and error message

for a clear validation and clean code

* validation: update validationSnsConfig method

to let the compiler guess variable type

* validation: update import order

to fix golang lint check

* trigger ci
This commit is contained in:
Nutmos
2026-01-14 04:06:54 +08:00
committed by GitHub
parent ae136648da
commit e7e119fbba
20 changed files with 202 additions and 40 deletions

View File

@@ -1204,7 +1204,7 @@ func testAlertmanagerConfigCRD(t *testing.T) {
}},
SNSConfigs: []monitoringv1alpha1.SNSConfig{
{
ApiURL: "https://sns.us-east-2.amazonaws.com",
ApiURL: ptr.To(monitoringv1alpha1.URL("https://sns.us-east-2.amazonaws.com")),
Sigv4: &monitoringv1.Sigv4{
Region: "us-east-2",
AccessKey: &v1.SecretKeySelector{
@@ -1220,7 +1220,7 @@ func testAlertmanagerConfigCRD(t *testing.T) {
Key: testingSecretKey,
},
},
TopicARN: "test-topicARN",
TopicARN: ptr.To("test-topicARN"),
},
},
WebexConfigs: []monitoringv1alpha1.WebexConfig{{