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 #666 from fao89/errstatus
Browse files Browse the repository at this point in the history
Update status on setup errors
  • Loading branch information
openshift-merge-bot[bot] authored Feb 15, 2024
2 parents e426bf2 + 9506604 commit dc64452
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controllers/openstackdataplanedeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context,
instance.Status.Conditions.MarkFalse(
condition.ReadyCondition,
condition.ErrorReason,
condition.SeverityWarning,
condition.SeverityError,
dataplanev1.DataPlaneNodeSetErrorMessage,
err.Error())
}
Expand Down
17 changes: 15 additions & 2 deletions controllers/openstackdataplanenodeset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
// Ensure Services
err = deployment.EnsureServices(ctx, helper, instance)
if err != nil {
instance.Status.Conditions.MarkFalse(
dataplanev1.SetupReadyCondition,
condition.ErrorReason,
condition.SeverityError,
dataplanev1.DataPlaneNodeSetErrorMessage,
err.Error())
return ctrl.Result{}, err
}

Expand Down Expand Up @@ -267,7 +273,7 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
instance.Status.Conditions.MarkFalse(
condition.InputReadyCondition,
condition.RequestedReason,
condition.SeverityWarning,
condition.SeverityError,
err.Error())
}
return result, err
Expand Down Expand Up @@ -299,7 +305,14 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
_, err = deployment.GenerateNodeSetInventory(ctx, helper, instance,
allIPSets, dnsAddresses, dataplaneAnsibleImageDefaults)
if err != nil {
util.LogErrorForObject(helper, err, fmt.Sprintf("Unable to generate inventory for %s", instance.Name), instance)
errorMsg := fmt.Sprintf("Unable to generate inventory for %s", instance.Name)
util.LogErrorForObject(helper, err, errorMsg, instance)
instance.Status.Conditions.MarkFalse(
dataplanev1.SetupReadyCondition,
condition.ErrorReason,
condition.SeverityError,
dataplanev1.DataPlaneNodeSetErrorMessage,
errorMsg)
return ctrl.Result{}, err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (d *Deployer) ConditionalDeploy(
nsConditions.Set(condition.FalseCondition(
readyCondition,
condition.ErrorReason,
condition.SeverityWarning,
condition.SeverityError,
readyErrorMessage,
err.Error()))
}
Expand Down

0 comments on commit dc64452

Please sign in to comment.