Skip to content

Commit

Permalink
Merge pull request #44 from Kshatrix/mgmt-status
Browse files Browse the repository at this point in the history
Remove separate core status for now
  • Loading branch information
Kshatrix authored Jun 21, 2024
2 parents f2d85ee + 10f4066 commit c36dd3e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 130 deletions.
17 changes: 3 additions & 14 deletions api/v1alpha1/management_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (in *Component) HelmValues() (values map[string]interface{}, err error) {
func (m ManagementSpec) SetDefaults() {
// TODO: Uncomment when Templates will be ready
/*
m.Providers = []Component{
m.Components = []Component{
{
Template: "cluster-api",
},
Expand All @@ -90,10 +90,8 @@ type ManagementStatus struct {
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// AvailableProviders holds all CAPI providers available on the Management cluster.
AvailableProviders Providers `json:"availableProviders,omitempty"`
// Core indicates the status of installed core components.
Core CoreStatus `json:"core,omitempty"`
// Providers indicates the status of installed CAPI providers.
Providers map[string]ComponentStatus `json:"providers,omitempty"`
// Components indicates the status of installed HMC components and CAPI providers.
Components map[string]ComponentStatus `json:"components,omitempty"`
}

// ComponentStatus is the status of Management component installation
Expand All @@ -104,15 +102,6 @@ type ComponentStatus struct {
Error string `json:"error,omitempty"`
}

type CoreStatus struct {
// HMC indicates the status of the installed HMC component.
HMC ComponentStatus `json:"HMC,omitempty"`
// CAPI indicates the status of the installed CAPI component.
CAPI ComponentStatus `json:"CAPI,omitempty"`
// CertManager indicates the status of the installed CertManager component.
CertManager ComponentStatus `json:"certManager,omitempty"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// +kubebuilder:resource:shortName=hmc-mgmt;mgmt
Expand Down
23 changes: 2 additions & 21 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 7 additions & 47 deletions config/crd/bases/hmc.mirantis.com_managements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,52 +149,7 @@ spec:
type: string
type: array
type: object
core:
description: Core indicates the status of installed core components.
properties:
CAPI:
description: CAPI indicates the status of the installed CAPI component.
properties:
error:
description: Error stores as error message in case of failed
installation
type: string
success:
description: Success represents if a component installation
was successful
type: boolean
type: object
HMC:
description: HMC indicates the status of the installed HMC component.
properties:
error:
description: Error stores as error message in case of failed
installation
type: string
success:
description: Success represents if a component installation
was successful
type: boolean
type: object
certManager:
description: CertManager indicates the status of the installed
CertManager component.
properties:
error:
description: Error stores as error message in case of failed
installation
type: string
success:
description: Success represents if a component installation
was successful
type: boolean
type: object
type: object
observedGeneration:
description: ObservedGeneration is the last observed generation.
format: int64
type: integer
providers:
components:
additionalProperties:
description: ComponentStatus is the status of Management component
installation
Expand All @@ -208,8 +163,13 @@ spec:
was successful
type: boolean
type: object
description: Providers indicates the status of installed CAPI providers.
description: Components indicates the status of installed HMC components
and CAPI providers.
type: object
observedGeneration:
description: ObservedGeneration is the last observed generation.
format: int64
type: integer
type: object
type: object
served: true
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/management_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (r *ManagementReconciler) Reconcile(ctx context.Context, req ctrl.Request)

management.Status.ObservedGeneration = management.Generation
management.Status.AvailableProviders = detectedProviders
management.Status.Providers = detectedComponents
management.Status.Components = detectedComponents
if err := r.Status().Update(ctx, management); err != nil {
errs = errors.Join(fmt.Errorf("failed to update status for Management %s/%s: %w", management.Namespace, management.Name, err))
}
Expand Down
54 changes: 7 additions & 47 deletions templates/hmc/templates/management-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,52 +149,7 @@ spec:
type: string
type: array
type: object
core:
description: Core indicates the status of installed core components.
properties:
CAPI:
description: CAPI indicates the status of the installed CAPI component.
properties:
error:
description: Error stores as error message in case of failed
installation
type: string
success:
description: Success represents if a component installation
was successful
type: boolean
type: object
HMC:
description: HMC indicates the status of the installed HMC component.
properties:
error:
description: Error stores as error message in case of failed
installation
type: string
success:
description: Success represents if a component installation
was successful
type: boolean
type: object
certManager:
description: CertManager indicates the status of the installed CertManager
component.
properties:
error:
description: Error stores as error message in case of failed
installation
type: string
success:
description: Success represents if a component installation
was successful
type: boolean
type: object
type: object
observedGeneration:
description: ObservedGeneration is the last observed generation.
format: int64
type: integer
providers:
components:
additionalProperties:
description: ComponentStatus is the status of Management component
installation
Expand All @@ -207,8 +162,13 @@ spec:
successful
type: boolean
type: object
description: Providers indicates the status of installed CAPI providers.
description: Components indicates the status of installed HMC components
and CAPI providers.
type: object
observedGeneration:
description: ObservedGeneration is the last observed generation.
format: int64
type: integer
type: object
type: object
served: true
Expand Down

0 comments on commit c36dd3e

Please sign in to comment.