diff --git a/apis/core/v1beta1/conditions.go b/apis/core/v1beta1/conditions.go index c0617e70e..7456fbb59 100644 --- a/apis/core/v1beta1/conditions.go +++ b/apis/core/v1beta1/conditions.go @@ -478,6 +478,8 @@ const ( OpenStackVersionMinorUpdateControlplane condition.Type = "MinorUpdateControlplane" OpenStackVersionMinorUpdateDataplane condition.Type = "MinorUpdateDataplane" + + OpenStackVersionMinorUpdateAvailable condition.Type = "MinorUpdateAvailable" ) // Version Messages used by API objects. @@ -506,4 +508,7 @@ const ( // OpenStackVersionMinorUpdateReadyErrorMessage OpenStackVersionMinorUpdateReadyErrorMessage = "error occured %s" + + // OpenStackVersionMinorUpdateAvailableMessage + OpenStackVersionMinorUpdateAvailableMessage = "update available" ) diff --git a/controllers/core/openstackversion_controller.go b/controllers/core/openstackversion_controller.go index 88d50998d..2de634a38 100644 --- a/controllers/core/openstackversion_controller.go +++ b/controllers/core/openstackversion_controller.go @@ -301,6 +301,13 @@ func (r *OpenStackVersionReconciler) Reconcile(ctx context.Context, req ctrl.Req Log.Info("Setting DeployedVersion") instance.Status.DeployedVersion = &instance.Spec.TargetVersion } + if *instance.Status.AvailableVersion != *instance.Status.DeployedVersion { + instance.Status.Conditions.Set(condition.TrueCondition( + corev1beta1.OpenStackVersionMinorUpdateAvailable, + corev1beta1.OpenStackVersionMinorUpdateAvailableMessage)) + } else { + instance.Status.Conditions.Remove(corev1beta1.OpenStackVersionMinorUpdateAvailable) + } return ctrl.Result{}, nil }