Skip to content

Commit 8f6e5fa

Browse files
committed
Drop ExternalInfraCluster CRD in favour of AWSCluster
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.
1 parent d74122f commit 8f6e5fa

File tree

10 files changed

+154
-194
lines changed

10 files changed

+154
-194
lines changed

api/v1alpha1/hosted_controlplane.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,20 @@ type HostedControlPlaneCondition struct {
107107
type HostedControlPlaneStatus struct {
108108
// Ready denotes that the HostedControlPlane API Server is ready to
109109
// receive requests
110+
// This satisfies CAPI contract https://github.com/kubernetes-sigs/cluster-api/blob/cd3a694deac89d5ebeb888307deaa61487207aa0/controllers/cluster_controller_phases.go#L226-L230
110111
// +kubebuilder:validation:Required
111112
// +kubebuilder:default=false
112113
Ready bool `json:"ready"`
113114

115+
// Initialized denotes whether or not the control plane has
116+
// provided a kubeadm-config.
117+
// Once this condition is marked true, its value is never changed. See the Ready condition for an indication of
118+
// the current readiness of the cluster's control plane.
119+
// This satisfies CAPI contract https://github.com/kubernetes-sigs/cluster-api/blob/cd3a694deac89d5ebeb888307deaa61487207aa0/controllers/cluster_controller_phases.go#L238-L252
120+
// +kubebuilder:validation:Required
121+
// +kubebuilder:default=false
122+
Initialized bool `json:"initialized"`
123+
114124
// ExternalManagedControlPlane indicates to cluster-api that the control plane
115125
// is managed by an external service.
116126
// https://github.com/kubernetes-sigs/cluster-api/blob/65e5385bffd71bf4aad3cf34a537f11b217c7fab/controllers/machine_controller.go#L468

cmd/install/assets/hypershift-operator/hypershift.openshift.io_hostedcontrolplanes.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,10 @@ spec:
354354
default: true
355355
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
356356
type: boolean
357+
initialized:
358+
default: false
359+
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
360+
type: boolean
357361
kubeConfig:
358362
description: KubeConfig is a reference to the secret containing the default kubeconfig for this control plane.
359363
properties:
@@ -371,7 +375,7 @@ spec:
371375
type: string
372376
ready:
373377
default: false
374-
description: Ready denotes that the HostedControlPlane API Server is ready to receive requests
378+
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
375379
type: boolean
376380
releaseImage:
377381
description: ReleaseImage is the release image applied to the hosted control plane.
@@ -381,6 +385,7 @@ spec:
381385
type: string
382386
required:
383387
- conditions
388+
- initialized
384389
- ready
385390
type: object
386391
type: object

control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ func (r *HostedControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.R
452452
}
453453

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

hypershift-operator/controllers/externalinfracluster/externalinfracluster_controller.go

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)