Skip to content

Commit c0629de

Browse files
committed
clean handler action
1 parent eabc3bb commit c0629de

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

internal/actions/approve_csr_handler.go

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,18 @@ package actions
22

33
import (
44
"context"
5-
"time"
6-
7-
"github.com/sirupsen/logrus"
8-
"k8s.io/client-go/kubernetes"
9-
105
"github.com/castai/cluster-controller/internal/castai"
116
)
127

13-
const (
14-
approveCSRTimeout = 4 * time.Minute
15-
)
8+
// TODO deprecated action
169

1710
var _ ActionHandler = &ApproveCSRHandler{}
1811

19-
func NewApproveCSRHandler(log logrus.FieldLogger, clientset kubernetes.Interface) *ApproveCSRHandler {
20-
return &ApproveCSRHandler{
21-
log: log,
22-
clientset: clientset,
23-
initialCSRFetchTimeout: 5 * time.Minute,
24-
csrFetchInterval: 5 * time.Second,
25-
}
12+
func NewApproveCSRHandler() *ApproveCSRHandler {
13+
return &ApproveCSRHandler{}
2614
}
2715

28-
type ApproveCSRHandler struct {
29-
log logrus.FieldLogger
30-
clientset kubernetes.Interface
31-
initialCSRFetchTimeout time.Duration
32-
csrFetchInterval time.Duration
33-
}
16+
type ApproveCSRHandler struct{}
3417

3518
func (h *ApproveCSRHandler) Handle(_ context.Context, _ *castai.ClusterAction) error {
3619
return nil

internal/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func NewService(
5555
reflect.TypeOf(&castai.ActionDrainNode{}): actions.NewDrainNodeHandler(log, clientset, cfg.Namespace),
5656
reflect.TypeOf(&castai.ActionPatchNode{}): actions.NewPatchNodeHandler(log, clientset),
5757
reflect.TypeOf(&castai.ActionCreateEvent{}): actions.NewCreateEventHandler(log, clientset),
58-
reflect.TypeOf(&castai.ActionApproveCSR{}): actions.NewApproveCSRHandler(log, clientset),
58+
reflect.TypeOf(&castai.ActionApproveCSR{}): actions.NewApproveCSRHandler(),
5959
reflect.TypeOf(&castai.ActionChartUpsert{}): actions.NewChartUpsertHandler(log, helmClient),
6060
reflect.TypeOf(&castai.ActionChartUninstall{}): actions.NewChartUninstallHandler(log, helmClient),
6161
reflect.TypeOf(&castai.ActionChartRollback{}): actions.NewChartRollbackHandler(log, helmClient, cfg.Version),

0 commit comments

Comments
 (0)