Skip to content

Commit ba79757

Browse files
Process error and fail reconciliation
1 parent 005d329 commit ba79757

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pkg/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type CodeFlareOperatorConfiguration struct {
3434
type KubeRayConfiguration struct {
3535
RayDashboardOAuthEnabled *bool `json:"rayDashboardOAuthEnabled,omitempty"`
3636

37-
IngressDomain string `json:"ingressDomain,omitempty"`
37+
IngressDomain string `json:"ingressDomain"`
3838
}
3939

4040
type ControllerManager struct {

pkg/controllers/raycluster_controller.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,24 @@ func (r *RayClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request)
187187
logger.Info("We detected being on Vanilla Kubernetes!")
188188
logger.Info("Creating Dashboard Ingress")
189189
dashboardName := dashboardNameFromCluster(&cluster)
190-
dashboardIngressHost, _ := r.getIngressHost(ctx, r.kubeClient, &cluster, dashboardName)
191-
_, err := r.kubeClient.NetworkingV1().Ingresses(cluster.Namespace).Apply(ctx, desiredClusterIngress(&cluster, dashboardIngressHost), metav1.ApplyOptions{FieldManager: controllerName, Force: true})
190+
dashboardIngressHost, err := r.getIngressHost(ctx, r.kubeClient, &cluster, dashboardName)
191+
if err != nil{
192+
logger.Error(err, "missing IngressDomain configuration in ConfigMap 'codeflare-operator-config'")
193+
return ctrl.Result{RequeueAfter: requeueTime}, err
194+
}
195+
_, err = r.kubeClient.NetworkingV1().Ingresses(cluster.Namespace).Apply(ctx, desiredClusterIngress(&cluster, dashboardIngressHost), metav1.ApplyOptions{FieldManager: controllerName, Force: true})
192196
if err != nil {
193197
// This log is info level since errors are not fatal and are expected
194198
logger.Info("WARN: Failed to update Dashboard Ingress", "error", err.Error(), logRequeueing, true)
195199
return ctrl.Result{RequeueAfter: requeueTime}, err
196200
}
197201
logger.Info("Creating RayClient Ingress")
198202
rayClientName := rayClientNameFromCluster(&cluster)
199-
rayClientIngressHost, _ := r.getIngressHost(ctx, r.kubeClient, &cluster, rayClientName)
203+
rayClientIngressHost, err := r.getIngressHost(ctx, r.kubeClient, &cluster, rayClientName)
204+
if err != nil {
205+
logger.Error(err, "missing IngressDomain configuration in ConfigMap 'codeflare-operator-config'")
206+
return ctrl.Result{RequeueAfter: requeueTime}, err
207+
}
200208
_, err = r.kubeClient.NetworkingV1().Ingresses(cluster.Namespace).Apply(ctx, desiredRayClientIngress(&cluster, rayClientIngressHost), metav1.ApplyOptions{FieldManager: controllerName, Force: true})
201209
if err != nil {
202210
logger.Error(err, "Failed to update RayClient Ingress")

0 commit comments

Comments
 (0)