Skip to content

Commit

Permalink
Remove AWSManagedMachinePool watcher (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: rasel <[email protected]>
  • Loading branch information
Superm4n97 authored Oct 10, 2023
1 parent f39692b commit d961383
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 3,353 deletions.
2 changes: 0 additions & 2 deletions pkg/cmds/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
ec2api "kubeform.dev/provider-aws/apis/ec2/v1alpha1"
infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1"
ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/eks/api/v1beta1"
capaExp "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
)
Expand All @@ -48,7 +47,6 @@ func init() {
utilruntime.Must(infrav1.AddToScheme(scheme))
utilruntime.Must(ec2api.AddToScheme(scheme))
utilruntime.Must(ekscontrolplanev1.AddToScheme(scheme))
utilruntime.Must(capaExp.AddToScheme(scheme))
}

func NewCmdRun() *cobra.Command {
Expand Down
16 changes: 0 additions & 16 deletions pkg/controllers/awsmanagedcontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ import (
"k8s.io/klog/v2"
ec2api "kubeform.dev/provider-aws/apis/ec2/v1alpha1"
eksapi "sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/eks/api/v1beta1"
expapi "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"
)

// AWSManagedControlPlaneReconciler reconciles a Crossplane object
Expand Down Expand Up @@ -119,17 +115,5 @@ func (r *AWSManagedControlPlaneReconciler) Reconcile(ctx context.Context, req ct
func (r *AWSManagedControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&eksapi.AWSManagedControlPlane{}).
Watches(
&source.Kind{Type: &expapi.AWSManagedMachinePool{}},
handler.EnqueueRequestsFromMapFunc(func(object client.Object) []reconcile.Request {
reconcileReq := make([]reconcile.Request, 0)
managedCP, err := firewall.GetManagedControlPlane(context.TODO(), r.Client)
if err != nil {
return reconcileReq
}
reconcileReq = append(reconcileReq, reconcile.Request{NamespacedName: client.ObjectKey{Name: managedCP.Name, Namespace: managedCP.Namespace}})
return reconcileReq
}),
).
Complete(r)
}
1 change: 0 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,6 @@ sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1
sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2
sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/eks/api/v1beta1
sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/eks/api/v1beta2
sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1
sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2
sigs.k8s.io/cluster-api-provider-aws/v2/feature
sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1
Expand Down

This file was deleted.

Loading

0 comments on commit d961383

Please sign in to comment.