diff --git a/.circleci/config.yml b/.circleci/config.yml index a556eac..c22df87 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,3 +62,16 @@ workflows: ignore: /.*/ tags: only: /^v.*/ + + - architect/push-to-app-collection: + context: architect + name: push-to-vsphere-aws-addons-app-collection + app_name: "dns-operator-route53" + app_collection_repo: "vsphere-aws-addons-app-collection" + requires: + - push-to-app-catalog + filters: + branches: + ignore: /.*/ + tags: + only: /^v.*/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 4146790..3348f04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Do not reconcile Cluster if the infrastructure cluster kind is AWSCluster. + ## [0.9.0] - 2024-07-25 ### Changed diff --git a/controllers/cluster_controller.go b/controllers/cluster_controller.go index b58370d..f691af5 100644 --- a/controllers/cluster_controller.go +++ b/controllers/cluster_controller.go @@ -64,6 +64,12 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct // get the InfrastructureRef (v1.ObjectReference) from the CAPI cluster infraRef := cluster.Spec.InfrastructureRef + // Return early if the infrastructure cluster type is not enabled + if !r.enabledInfrastructureProvider(infraRef.Kind) { + log.Info(fmt.Sprintf("Infrastructure provider %s is not enabled", infraRef.Kind)) + return reconcile.Result{}, nil + } + // set the GVK to the unstructured infraCluster infraCluster.SetGroupVersionKind(infraRef.GroupVersionKind()) @@ -188,3 +194,15 @@ func (r *ClusterReconciler) reconcileDelete(ctx context.Context, clusterScope *s RequeueAfter: time.Minute * 5, }, nil } + +// check if the infrastructure provider is enabled +// for now we simply disable the AWS provider here. +// if needed in the future we should extend this to accept a list of enabled providers from the config. +func (r *ClusterReconciler) enabledInfrastructureProvider(kind string) bool { + switch kind { + case "AWSCluster": + return false + default: + return true + } +}