Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not reconcile aws infrastructure clusters #244

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions controllers/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down Expand Up @@ -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
}
}