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

Commit

Permalink
Merge pull request #695 from fao89/statuses
Browse files Browse the repository at this point in the history
Update status on setup/input errors
  • Loading branch information
openshift-merge-bot[bot] authored Feb 21, 2024
2 parents 8f09133 + f0d4f1c commit 75fab92
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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

0 comments on commit 75fab92

Please sign in to comment.