Skip to content

Commit

Permalink
Add availableProviders field to Management object
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Pavlov <[email protected]>
  • Loading branch information
Kshatrix committed Jun 18, 2024
1 parent d602434 commit cb74540
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 47 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/management_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ type ManagementStatus struct {
// ObservedGeneration is the last observed generation.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Providers is the list of discovered supported providers
Providers Providers `json:"providers,omitempty"`
// AvailableProviders is the list of discovered supported providers
AvailableProviders Providers `json:"availableProviders,omitempty"`
// Components contains the map with the status of Management components installation
Components map[string]ComponentStatus `json:"components,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

45 changes: 23 additions & 22 deletions config/crd/bases/hmc.mirantis.com_managements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,29 @@ spec:
status:
description: ManagementStatus defines the observed state of Management
properties:
availableProviders:
description: AvailableProviders is the list of discovered supported
providers
properties:
bootstrap:
description: BootstrapProviders is the list of CAPI bootstrap
providers
items:
type: string
type: array
controlPlane:
description: ControlPlaneProviders is the list of CAPI control
plane providers
items:
type: string
type: array
infrastructure:
description: InfrastructureProviders is the list of CAPI infrastructure
providers
items:
type: string
type: array
type: object
components:
additionalProperties:
description: ComponentStatus is the status of Management component
Expand All @@ -86,28 +109,6 @@ spec:
description: ObservedGeneration is the last observed generation.
format: int64
type: integer
providers:
description: Providers is the list of discovered supported providers
properties:
bootstrap:
description: BootstrapProviders is the list of CAPI bootstrap
providers
items:
type: string
type: array
controlPlane:
description: ControlPlaneProviders is the list of CAPI control
plane providers
items:
type: string
type: array
infrastructure:
description: InfrastructureProviders is the list of CAPI infrastructure
providers
items:
type: string
type: array
type: object
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 @@ -109,7 +109,7 @@ func (r *ManagementReconciler) Reconcile(ctx context.Context, req ctrl.Request)
}

management.Status.ObservedGeneration = management.Generation
management.Status.Providers = detectedProviders
management.Status.AvailableProviders = detectedProviders
management.Status.Components = detectedComponents
if err := r.Status().Update(ctx, management); err != nil {
return ctrl.Result{}, fmt.Errorf("failed to update status for Management %s/%s: %w", management.Namespace, management.Name, err)
Expand Down
43 changes: 22 additions & 21 deletions templates/hmc/templates/management-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,28 @@ spec:
status:
description: ManagementStatus defines the observed state of Management
properties:
availableProviders:
description: AvailableProviders is the list of discovered supported
providers
properties:
bootstrap:
description: BootstrapProviders is the list of CAPI bootstrap providers
items:
type: string
type: array
controlPlane:
description: ControlPlaneProviders is the list of CAPI control plane
providers
items:
type: string
type: array
infrastructure:
description: InfrastructureProviders is the list of CAPI infrastructure
providers
items:
type: string
type: array
type: object
components:
additionalProperties:
description: ComponentStatus is the status of Management component
Expand All @@ -86,27 +108,6 @@ spec:
description: ObservedGeneration is the last observed generation.
format: int64
type: integer
providers:
description: Providers is the list of discovered supported providers
properties:
bootstrap:
description: BootstrapProviders is the list of CAPI bootstrap providers
items:
type: string
type: array
controlPlane:
description: ControlPlaneProviders is the list of CAPI control plane
providers
items:
type: string
type: array
infrastructure:
description: InfrastructureProviders is the list of CAPI infrastructure
providers
items:
type: string
type: array
type: object
type: object
type: object
served: true
Expand Down

0 comments on commit cb74540

Please sign in to comment.