Skip to content

Commit

Permalink
chore: remove v1alpha5 from lifecycle/consistency/garbage collection (k…
Browse files Browse the repository at this point in the history
  • Loading branch information
njtran authored Nov 1, 2023
1 parent f1ecb56 commit edbb9aa
Show file tree
Hide file tree
Showing 25 changed files with 340 additions and 2,294 deletions.
3 changes: 0 additions & 3 deletions pkg/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,9 @@ func NewControllers(
metricsnodepool.NewController(kubeClient),
metricsnode.NewController(cluster),
nodepoolcounter.NewNodePoolController(kubeClient, cluster),
nodeclaimconsistency.NewMachineController(clock, kubeClient, recorder, cloudProvider),
nodeclaimconsistency.NewNodeClaimController(clock, kubeClient, recorder, cloudProvider),
nodeclaimlifecycle.NewMachineController(clock, kubeClient, cloudProvider, recorder),
nodeclaimlifecycle.NewNodeClaimController(clock, kubeClient, cloudProvider, recorder),
nodeclaimgarbagecollection.NewController(clock, kubeClient, cloudProvider),
nodeclaimtermination.NewMachineController(kubeClient, cloudProvider),
nodeclaimtermination.NewNodeClaimController(kubeClient, cloudProvider),
nodeclaimdisruption.NewNodeClaimController(clock, kubeClient, cluster, cloudProvider),
leasegarbagecollection.NewController(kubeClient),
Expand Down
34 changes: 0 additions & 34 deletions pkg/controllers/nodeclaim/consistency/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ import (
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/aws/karpenter-core/pkg/apis/v1alpha5"
"github.com/aws/karpenter-core/pkg/apis/v1beta1"
"github.com/aws/karpenter-core/pkg/cloudprovider"
"github.com/aws/karpenter-core/pkg/events"
corecontroller "github.com/aws/karpenter-core/pkg/operator/controller"
machineutil "github.com/aws/karpenter-core/pkg/utils/machine"
nodeclaimutil "github.com/aws/karpenter-core/pkg/utils/nodeclaim"
)

Expand Down Expand Up @@ -140,35 +138,3 @@ func (c *NodeClaimController) Builder(_ context.Context, m manager.Manager) core
WithOptions(controller.Options{MaxConcurrentReconciles: 10}),
)
}

type MachineController struct {
*Controller
}

func NewMachineController(clk clock.Clock, kubeClient client.Client, recorder events.Recorder,
provider cloudprovider.CloudProvider) corecontroller.Controller {

return corecontroller.Typed[*v1alpha5.Machine](kubeClient, &MachineController{
Controller: NewController(clk, kubeClient, recorder, provider),
})
}

func (c *MachineController) Name() string {
return "consistency"
}

func (c *MachineController) Reconcile(ctx context.Context, machine *v1alpha5.Machine) (reconcile.Result, error) {
return c.Controller.Reconcile(ctx, nodeclaimutil.New(machine))
}

func (c *MachineController) Builder(_ context.Context, m manager.Manager) corecontroller.Builder {
return corecontroller.Adapt(controllerruntime.
NewControllerManagedBy(m).
For(&v1alpha5.Machine{}).
Watches(
&v1.Node{},
machineutil.NodeEventHandler(c.kubeClient),
).
WithOptions(controller.Options{MaxConcurrentReconciles: 10}),
)
}
111 changes: 0 additions & 111 deletions pkg/controllers/nodeclaim/consistency/machine_test.go

This file was deleted.

111 changes: 0 additions & 111 deletions pkg/controllers/nodeclaim/consistency/nodeclaim_test.go

This file was deleted.

Loading

0 comments on commit edbb9aa

Please sign in to comment.