mirror of
https://github.com/coreos/prometheus-operator.git
synced 2026-02-05 06:45:27 +01:00
Test name colision between Prometheus Server and Agent (#5582)
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
committed by
GitHub
parent
b5327e7e66
commit
a487750b37
@@ -290,6 +290,7 @@ func testAllNSPrometheus(t *testing.T) {
|
||||
"RelabelConfigCRDValidation": testRelabelConfigCRDValidation,
|
||||
"PromReconcileStatusWhenInvalidRuleCreated": testPromReconcileStatusWhenInvalidRuleCreated,
|
||||
"CreatePrometheusAgent": testCreatePrometheusAgent,
|
||||
"PrometheusAgentAndServerNameColision": testAgentAndServerNameColision,
|
||||
}
|
||||
|
||||
for name, f := range testFuncs {
|
||||
|
||||
@@ -40,3 +40,32 @@ func testCreatePrometheusAgent(t *testing.T) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func testAgentAndServerNameColision(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCtx := framework.NewTestCtx(t)
|
||||
defer testCtx.Cleanup(t)
|
||||
|
||||
ns := framework.CreateNamespace(context.Background(), t, testCtx)
|
||||
framework.SetupPrometheusRBAC(context.Background(), t, testCtx, ns)
|
||||
name := "test"
|
||||
|
||||
prometheusAgentCRD := framework.MakeBasicPrometheusAgent(ns, name, name, 1)
|
||||
prometheusCRD := framework.MakeBasicPrometheus(ns, name, name, 1)
|
||||
|
||||
if _, err := framework.CreatePrometheusAgentAndWaitUntilReady(context.Background(), ns, prometheusAgentCRD); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := framework.CreatePrometheusAndWaitUntilReady(context.Background(), ns, prometheusCRD); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := framework.DeletePrometheusAgentAndWaitUntilGone(context.Background(), ns, name); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := framework.DeletePrometheusAndWaitUntilGone(context.Background(), ns, name); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user