Skip to content

Commit cb0e03e

Browse files
Return error message if IngressDomain configuration not set
1 parent 69588ea commit cb0e03e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func main() {
115115
},
116116
KubeRay: &config.KubeRayConfiguration{
117117
RayDashboardOAuthEnabled: pointer.Bool(true),
118-
IngressDomain: "fake.domain",
118+
IngressDomain: "",
119119
},
120120
}
121121

pkg/controllers/support.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,17 @@ func isOpenShift(ctx context.Context, clientset *kubernetes.Clientset, cluster *
139139
}
140140

141141
// getIngressHost generates the cluster URL string based on the cluster type, RayCluster, and ingress domain.
142-
func (r *RayClusterReconciler) getIngressHost(ctx context.Context, clientset *kubernetes.Clientset, cluster *rayv1.RayCluster, ingressNameFromCluster string) string {
143-
ingressDomain := "fake.domain"
142+
func (r *RayClusterReconciler) getIngressHost(ctx context.Context, clientset *kubernetes.Clientset, cluster *rayv1.RayCluster, ingressNameFromCluster string) (string, error) {
143+
ingressDomain := ""
144144
if r.Config != nil && r.Config.IngressDomain != "" {
145145
ingressDomain = r.Config.IngressDomain
146+
} else {
147+
return "", fmt.Errorf("Missing IngressDomain configuration in ConfigMap 'codeflare-operator-config'")
146148
}
147149
if ingressDomain == "kind" {
148-
return ingressDomain
150+
return ingressDomain, nil
149151
}
150-
return fmt.Sprintf("%s-%s.%s", ingressNameFromCluster, cluster.Namespace, ingressDomain)
152+
return fmt.Sprintf("%s-%s.%s", ingressNameFromCluster, cluster.Namespace, ingressDomain), nil
151153
}
152154

153155
func (r *RayClusterReconciler) isRayDashboardOAuthEnabled() bool {

0 commit comments

Comments
 (0)