Skip to content

Commit

Permalink
Drop ExternalInfraCluster CRD in favour of AWSCluster
Browse files Browse the repository at this point in the history
This PR drops the ExternalInfraCluster CRD in favour of AWSCluster.

Originally we added support for externally managed infra in CAPA via the ExternalInfraCluster CRD kubernetes-sigs/cluster-api-provider-aws#2124 and we used that commit of CAPA in hypershift.

Later on we decided to revert that approach upstream and reuse the existing ${infra}Cluster CRDs with an annotation to support externally managed infrastructure kubernetes-sigs/cluster-api#4135

This PR bring latest CAPI/CAPA.

As a follow up we need to rebuild the images and consume them from quay.io/hypershift.
  • Loading branch information
enxebre committed Jun 2, 2021
1 parent d74122f commit 8f6e5fa
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 194 deletions.
10 changes: 10 additions & 0 deletions api/v1alpha1/hosted_controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,20 @@ type HostedControlPlaneCondition struct {
type HostedControlPlaneStatus struct {
// Ready denotes that the HostedControlPlane API Server is ready to
// receive requests
// This satisfies CAPI contract https://github.com/kubernetes-sigs/cluster-api/blob/cd3a694deac89d5ebeb888307deaa61487207aa0/controllers/cluster_controller_phases.go#L226-L230
// +kubebuilder:validation:Required
// +kubebuilder:default=false
Ready bool `json:"ready"`

// Initialized denotes whether or not the control plane has
// provided a kubeadm-config.
// Once this condition is marked true, its value is never changed. See the Ready condition for an indication of
// the current readiness of the cluster's control plane.
// This satisfies CAPI contract https://github.com/kubernetes-sigs/cluster-api/blob/cd3a694deac89d5ebeb888307deaa61487207aa0/controllers/cluster_controller_phases.go#L238-L252
// +kubebuilder:validation:Required
// +kubebuilder:default=false
Initialized bool `json:"initialized"`

// ExternalManagedControlPlane indicates to cluster-api that the control plane
// is managed by an external service.
// https://github.com/kubernetes-sigs/cluster-api/blob/65e5385bffd71bf4aad3cf34a537f11b217c7fab/controllers/machine_controller.go#L468
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@ spec:
default: true
description: ExternalManagedControlPlane indicates to cluster-api that the control plane is managed by an external service. https://github.com/kubernetes-sigs/cluster-api/blob/65e5385bffd71bf4aad3cf34a537f11b217c7fab/controllers/machine_controller.go#L468
type: boolean
initialized:
default: false
description: Initialized denotes whether or not the control plane has provided a kubeadm-config. Once this condition is marked true, its value is never changed. See the Ready condition for an indication of the current readiness of the cluster's control plane. This satisfies CAPI contract https://github.com/kubernetes-sigs/cluster-api/blob/cd3a694deac89d5ebeb888307deaa61487207aa0/controllers/cluster_controller_phases.go#L238-L252
type: boolean
kubeConfig:
description: KubeConfig is a reference to the secret containing the default kubeconfig for this control plane.
properties:
Expand All @@ -371,7 +375,7 @@ spec:
type: string
ready:
default: false
description: Ready denotes that the HostedControlPlane API Server is ready to receive requests
description: Ready denotes that the HostedControlPlane API Server is ready to receive requests This satisfies CAPI contract https://github.com/kubernetes-sigs/cluster-api/blob/cd3a694deac89d5ebeb888307deaa61487207aa0/controllers/cluster_controller_phases.go#L226-L230
type: boolean
releaseImage:
description: ReleaseImage is the release image applied to the hosted control plane.
Expand All @@ -381,6 +385,7 @@ spec:
type: string
required:
- conditions
- initialized
- ready
type: object
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ func (r *HostedControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.R
}

r.Log.Info("Successfully reconciled")
oldStatus.Initialized = true
return r.setAvailableCondition(ctx, hostedControlPlane, oldStatus, hyperv1.ConditionTrue, "AsExpected", "HostedControlPlane is ready", ctrl.Result{}, nil)
}

Expand Down

This file was deleted.

Loading

0 comments on commit 8f6e5fa

Please sign in to comment.