Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Update status on setup/input errors #695

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions controllers/openstackdataplanedeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context,
Log.Info("NodeSet not found", "NodeSet", nodeSet)
return ctrl.Result{RequeueAfter: time.Second * time.Duration(instance.Spec.DeploymentRequeueTime)}, nil
}
instance.Status.Conditions.MarkFalse(
dataplanev1.SetupReadyCondition,
condition.ErrorReason,
condition.SeverityError,
dataplanev1.DataPlaneNodeSetErrorMessage,
err.Error())
// Error reading the object - requeue the request.
return ctrl.Result{}, err
}
Expand Down Expand Up @@ -177,12 +183,24 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context,
for _, serviceName := range services {
service, err := deployment.GetService(ctx, helper, serviceName)
if err != nil {
instance.Status.Conditions.MarkFalse(
condition.InputReadyCondition,
condition.ErrorReason,
condition.SeverityError,
dataplanev1.ServiceErrorMessage,
err.Error())
return ctrl.Result{}, err
}
if service.Spec.TLSCert != nil {
result, err := deployment.EnsureTLSCerts(ctx, helper, &nodeSet,
nodeSet.Status.AllHostnames, nodeSet.Status.AllIPs, service)
if err != nil {
instance.Status.Conditions.MarkFalse(
condition.InputReadyCondition,
condition.ErrorReason,
condition.SeverityError,
condition.TLSInputErrorMessage,
err.Error())
return ctrl.Result{}, err
} else if (*result != ctrl.Result{}) {
return *result, nil // requeue here
Expand Down
6 changes: 6 additions & 0 deletions controllers/openstackdataplanenodeset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req

deploymentExists, isDeploymentReady, err := checkDeployment(helper, instance)
if err != nil {
instance.Status.Conditions.MarkFalse(
condition.DeploymentReadyCondition,
condition.ErrorReason,
condition.SeverityError,
condition.DeploymentReadyErrorMessage,
err.Error())
Log.Error(err, "Unable to get deployed OpenStackDataPlaneDeployments.")
return ctrl.Result{}, err
}
Expand Down