Skip to content

Commit

Permalink
Add new OctaviaAmphoraCertsReadyCondition
Browse files Browse the repository at this point in the history
  • Loading branch information
weinimo committed Apr 24, 2024
1 parent 113ea27 commit 1e170c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const (
OctaviaHousekeepingReadyCondition condition.Type = "OctaviaHousekeepingReady"

OctaviaWorkerReadyCondition condition.Type = "OctaviaWorkerReady"

OctaviaAmphoraCertsReadyCondition condition.Type = "OctaviaAmphoraCertsReady"
)

// Common Messages used by API objects
Expand Down Expand Up @@ -69,4 +71,13 @@ const (

// OctaviaAmphoraControllerReadyErrorMessage
OctaviaWorkerReadyErrorMessage = "OctaviaWorker error occured %s"

//
// OctaviaAmphoraCertsReady condition messages
//
// OctaviaAmphoraCertsReadyInitMessage
OctaviaAmphoraCertsReadyInitMessage = "Octavia Amphora certificates are not initialized"

// OctaviaAmphoraCertsReadyErrorMessage
OctaviaAmphoraCertsReadyErrorMessage = "Octavia Amphora certificates error occured %s"
)
6 changes: 4 additions & 2 deletions controllers/octavia_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ func (r *OctaviaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re
condition.UnknownCondition(condition.NetworkAttachmentsReadyCondition, condition.InitReason, condition.NetworkAttachmentsReadyInitMessage),
condition.UnknownCondition(condition.ExposeServiceReadyCondition, condition.InitReason, condition.ExposeServiceReadyInitMessage),
condition.UnknownCondition(condition.DeploymentReadyCondition, condition.InitReason, condition.DeploymentReadyInitMessage),
condition.UnknownCondition(octaviav1.OctaviaAmphoraCertsReadyCondition, condition.InitReason, octaviav1.OctaviaAmphoraCertsReadyInitMessage),
amphoraControllerInitCondition(octaviav1.HealthManager),
amphoraControllerInitCondition(octaviav1.Housekeeping),
amphoraControllerInitCondition(octaviav1.Worker),
Expand Down Expand Up @@ -505,13 +506,14 @@ func (r *OctaviaReconciler) reconcileNormal(ctx context.Context, instance *octav
err = octavia.EnsureAmphoraCerts(ctx, instance, helper, &Log)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
condition.ServiceConfigReadyCondition,
octaviav1.OctaviaAmphoraCertsReadyCondition,
condition.ErrorReason,
condition.SeverityWarning,
condition.ServiceConfigReadyErrorMessage,
octaviav1.OctaviaAmphoraCertsReadyErrorMessage,
err.Error()))
return ctrl.Result{}, err
}
instance.Status.Conditions.MarkTrue(octaviav1.OctaviaAmphoraCertsReadyCondition, octaviav1.OctaviaAmphoraCertsReadyInitMessage)

if err = octavia.EnsureQuotas(ctx, instance, &r.Log, helper); err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
Expand Down

0 comments on commit 1e170c5

Please sign in to comment.