Skip to content

Commit

Permalink
Use specific complete message for new conditons
Browse files Browse the repository at this point in the history
  • Loading branch information
weinimo committed Apr 30, 2024
1 parent fbcc68b commit 6bc2f29
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 12 additions & 0 deletions api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ const (
// OctaviaAmphoraCertsReadyErrorMessage
OctaviaAmphoraCertsReadyErrorMessage = "Octavia Amphora certificates error occured %s"

// OctaviaAmphoraCertsReadyCompleteMessage
OctaviaAmphoraCertsReadyCompleteMessage = "Octavia Amphora certificates setup completed"

//
// OctaviaQuotasReady condition messages
//
Expand All @@ -96,6 +99,9 @@ const (
// OctaviaAmphoraCertsReadyErrorMessage
OctaviaQuotasReadyErrorMessage = "Octavia quotas setup error occured %s"

// OctaviaAmphoraSSHReadyCompleteMessage
OctaviaQuotasReadyCompleteMessage = "Octavia quotas setup completed"

//
// OctaviaAmphoraSSHReady condition messages
//
Expand All @@ -105,6 +111,9 @@ const (
// OctaviaAmphoraSSHReadyErrorMessage
OctaviaAmphoraSSHReadyErrorMessage = "Octavia Amphora SSH setup error occured %s"

// OctaviaAmphoraSSHReadyCompleteMessage
OctaviaAmphoraSSHReadyCompleteMessage = "Octavia Amphora SSH setup completed"

//
// OctaviaAmphoraImagesReady condition messages
//
Expand All @@ -113,4 +122,7 @@ const (

// OctaviaAmphoraImagesReadyErrorMessage
OctaviaAmphoraImagesReadyErrorMessage = "Octavia Amphora Images setup error occured %s"

// OctaviaAmphoraImagesReadyCompleteMessage
OctaviaAmphoraImagesReadyCompleteMessage = "Octavia Amphora Images setup completed"
)
12 changes: 8 additions & 4 deletions controllers/octavia_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,9 @@ func (r *OctaviaReconciler) reconcileNormal(ctx context.Context, instance *octav
err.Error()))
return ctrl.Result{}, err
}
instance.Status.Conditions.MarkTrue(octaviav1.OctaviaAmphoraCertsReadyCondition, octaviav1.OctaviaAmphoraCertsReadyInitMessage)
instance.Status.Conditions.MarkTrue(
octaviav1.OctaviaAmphoraCertsReadyCondition,
octaviav1.OctaviaAmphoraCertsReadyCompleteMessage)

if err = octavia.EnsureQuotas(ctx, instance, &r.Log, helper); err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
Expand All @@ -527,7 +529,9 @@ func (r *OctaviaReconciler) reconcileNormal(ctx context.Context, instance *octav
err.Error()))
return ctrl.Result{}, err
}
instance.Status.Conditions.MarkTrue(octaviav1.OctaviaQuotasReadyCondition, octaviav1.OctaviaQuotasReadyInitMessage)
instance.Status.Conditions.MarkTrue(
octaviav1.OctaviaQuotasReadyCondition,
octaviav1.OctaviaQuotasReadyCompleteMessage)

//
// TODO check when/if Init, Update, or Upgrade should/could be skipped
Expand Down Expand Up @@ -789,7 +793,7 @@ func (r *OctaviaReconciler) reconcileNormal(ctx context.Context, instance *octav
}
instance.Status.Conditions.MarkTrue(
octaviav1.OctaviaAmphoraSSHReadyCondition,
octaviav1.OctaviaAmphoraSSHReadyInitMessage)
octaviav1.OctaviaAmphoraSSHReadyCompleteMessage)

ctrlResult, err = r.reconcileAmphoraImages(ctx, instance, helper)
if (ctrlResult != ctrl.Result{}) {
Expand All @@ -806,7 +810,7 @@ func (r *OctaviaReconciler) reconcileNormal(ctx context.Context, instance *octav
}
instance.Status.Conditions.MarkTrue(
octaviav1.OctaviaAmphoraImagesReadyCondition,
octaviav1.OctaviaAmphoraImagesReadyInitMessage)
octaviav1.OctaviaAmphoraImagesReadyCompleteMessage)

// create Deployment - end

Expand Down

0 comments on commit 6bc2f29

Please sign in to comment.