Skip to content

Commit 834c597

Browse files
committed
Skip if openshift-monitoring namespace does not exist
1 parent ec95d6e commit 834c597

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/extended/prometheus/prometheus.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ var _ = g.Describe("[sig-instrumentation][Late] Platform Prometheus targets", fu
7474

7575
g.BeforeEach(func(ctx g.SpecContext) {
7676
var err error
77+
78+
kubeClient, err := kubernetes.NewForConfig(oc.AdminConfig())
79+
o.Expect(err).NotTo(o.HaveOccurred())
80+
nsExist, err := exutil.IsNamespaceExist(kubeClient, "openshift-monitoring")
81+
o.Expect(err).NotTo(o.HaveOccurred())
82+
if !nsExist {
83+
g.Skip("openshift-monitoring namespace does not exist, skipping")
84+
}
85+
7786
prometheusURL, err = helper.PrometheusRouteURL(ctx, oc)
7887
o.Expect(err).NotTo(o.HaveOccurred(), "Get public url of prometheus")
7988
bearerToken, err = helper.RequestPrometheusServiceAccountAPIToken(ctx, oc)

0 commit comments

Comments
 (0)