diff --git a/api/v1alpha1/management_types.go b/api/v1alpha1/management_types.go index f2b73174a..0763ac01a 100644 --- a/api/v1alpha1/management_types.go +++ b/api/v1alpha1/management_types.go @@ -94,6 +94,8 @@ type ManagementStatus struct { AvailableProviders Providers `json:"availableProviders,omitempty"` // Components indicates the status of installed HMC components and CAPI providers. Components map[string]ComponentStatus `json:"components,omitempty"` + // Release indicates the current Release object. + Release string `json:"release,omitempty"` } // ComponentStatus is the status of Management component installation diff --git a/internal/controller/management_controller.go b/internal/controller/management_controller.go index 26f846f1c..8cc80edb5 100644 --- a/internal/controller/management_controller.go +++ b/internal/controller/management_controller.go @@ -156,6 +156,7 @@ func (r *ManagementReconciler) Update(ctx context.Context, management *hmc.Manag management.Status.ObservedGeneration = management.Generation management.Status.AvailableProviders = detectedProviders management.Status.Components = detectedComponents + management.Status.Release = management.Spec.Release if err := r.Status().Update(ctx, management); err != nil { errs = errors.Join(errs, fmt.Errorf("failed to update status for Management %s: %w", management.Name, err)) diff --git a/templates/provider/hmc/templates/crds/hmc.mirantis.com_managements.yaml b/templates/provider/hmc/templates/crds/hmc.mirantis.com_managements.yaml index 21aed29a4..a0971a3cb 100644 --- a/templates/provider/hmc/templates/crds/hmc.mirantis.com_managements.yaml +++ b/templates/provider/hmc/templates/crds/hmc.mirantis.com_managements.yaml @@ -159,6 +159,9 @@ spec: description: ObservedGeneration is the last observed generation. format: int64 type: integer + release: + description: Release indicates the current Release object. + type: string type: object type: object served: true