Skip to content

Commit b4f3574

Browse files
committed
Fix conditions for urlSource
1 parent 32f020f commit b4f3574

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/kube/util/url.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,18 @@ func discoverURLFromRefs(client client.Client, ingressMonitor *endpointmonitorv1
6161
return "", errors.New("No URL sources set for ingressMonitor: " + ingressMonitor.Name)
6262
}
6363

64-
if urlFrom.IngressRef != nil && !kube.IsOpenshift {
64+
if urlFrom.IngressRef != nil {
65+
// if ingressRef is mentioned, it can be openshift or non openshift cluster
6566
return discoverURLFromIngressRef(client, urlFrom.IngressRef, ingressMonitor.Namespace, ingressMonitor.Spec.ForceHTTPS, ingressMonitor.Spec.HealthEndpoint)
66-
}
67-
if urlFrom.RouteRef != nil && kube.IsOpenshift {
67+
68+
} else if kube.IsOpenshift && urlFrom.RouteRef != nil {
69+
// if routeRef is mentioned in openshift cluster
6870
return discoverURLFromRouteRef(client, urlFrom.RouteRef, ingressMonitor.Namespace, ingressMonitor.Spec.ForceHTTPS, ingressMonitor.Spec.HealthEndpoint)
71+
72+
} else if !kube.IsOpenshift && urlFrom.RouteRef != nil {
73+
// if routeRef is mentioned in non openshift cluster
74+
log.V(1).Info("RouteRef is mentioned in kubernetes version: " + ingressMonitor.Name)
75+
6976
}
7077

7178
log.V(1).Info("Unsupported Ref set on ingressMonitor: " + ingressMonitor.Name)

0 commit comments

Comments
 (0)