Skip to content

Commit bfc746b

Browse files
committed
autoscaling upgrade + fixes
1 parent 87f2ab9 commit bfc746b

File tree

14 files changed

+686
-549
lines changed

14 files changed

+686
-549
lines changed

go.mod

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@ module k8s.io/cloud-provider-aws
33
go 1.24.4
44

55
require (
6+
github.com/aws/aws-sdk-go v1.55.7
67
github.com/aws/aws-sdk-go-v2 v1.36.5
78
github.com/aws/aws-sdk-go-v2/config v1.29.14
89
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.53.3
9-
github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2
10-
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.27.2
1110
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.3
1211
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.2
1312
github.com/aws/aws-sdk-go-v2/service/kms v1.41.0
14-
github.com/mitchellh/hashstructure/v2 v2.0.2
15-
github.com/onsi/ginkgo/v2 v2.23.0
16-
github.com/onsi/gomega v1.36.2
17-
github.com/samber/lo v1.49.1
13+
github.com/golang/mock v1.6.0
1814
github.com/spf13/cobra v1.8.1
1915
github.com/spf13/pflag v1.0.5
20-
github.com/stretchr/testify v1.8.4
16+
github.com/stretchr/testify v1.10.0
2117
golang.org/x/time v0.3.0
2218
gopkg.in/gcfg.v1 v1.2.3
2319
k8s.io/api v0.29.5
@@ -33,6 +29,12 @@ require (
3329
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
3430
)
3531

32+
require (
33+
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
34+
github.com/onsi/ginkgo/v2 v2.23.0 // indirect
35+
github.com/onsi/gomega v1.36.2 // indirect
36+
)
37+
3638
require (
3739
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
3840
github.com/NYTimes/gziphandler v1.1.1 // indirect
@@ -60,7 +62,7 @@ require (
6062
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
6163
github.com/felixge/httpsnoop v1.0.4 // indirect
6264
github.com/fsnotify/fsnotify v1.7.0 // indirect
63-
github.com/go-logr/logr v1.3.0 // indirect
65+
github.com/go-logr/logr v1.4.2 // indirect
6466
github.com/go-logr/stdr v1.2.2 // indirect
6567
github.com/go-openapi/jsonpointer v0.19.6 // indirect
6668
github.com/go-openapi/jsonreference v0.20.2 // indirect
@@ -93,7 +95,7 @@ require (
9395
github.com/prometheus/common v0.44.0 // indirect
9496
github.com/prometheus/procfs v0.10.1 // indirect
9597
github.com/stoewer/go-strcase v1.3.0 // indirect
96-
github.com/stretchr/objx v0.5.0 // indirect
98+
github.com/stretchr/objx v0.5.2 // indirect
9799
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
98100
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
99101
go.etcd.io/etcd/client/v3 v3.5.10 // indirect
@@ -109,22 +111,22 @@ require (
109111
go.uber.org/atomic v1.10.0 // indirect
110112
go.uber.org/multierr v1.11.0 // indirect
111113
go.uber.org/zap v1.24.0 // indirect
112-
golang.org/x/crypto v0.21.0 // indirect
114+
golang.org/x/crypto v0.33.0 // indirect
113115
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
114-
golang.org/x/mod v0.14.0 // indirect
115-
golang.org/x/net v0.23.0 // indirect
116+
golang.org/x/mod v0.23.0 // indirect
117+
golang.org/x/net v0.35.0 // indirect
116118
golang.org/x/oauth2 v0.11.0 // indirect
117-
golang.org/x/sync v0.5.0 // indirect
118-
golang.org/x/sys v0.18.0 // indirect
119-
golang.org/x/term v0.18.0 // indirect
120-
golang.org/x/text v0.14.0 // indirect
121-
golang.org/x/tools v0.16.1 // indirect
119+
golang.org/x/sync v0.11.0 // indirect
120+
golang.org/x/sys v0.30.0 // indirect
121+
golang.org/x/term v0.29.0 // indirect
122+
golang.org/x/text v0.22.0 // indirect
123+
golang.org/x/tools v0.30.0 // indirect
122124
google.golang.org/appengine v1.6.7 // indirect
123125
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
124126
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
125127
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
126128
google.golang.org/grpc v1.59.0 // indirect
127-
google.golang.org/protobuf v1.33.0 // indirect
129+
google.golang.org/protobuf v1.36.1 // indirect
128130
gopkg.in/inf.v0 v0.9.1 // indirect
129131
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
130132
gopkg.in/warnings.v0 v0.1.2 // indirect

go.sum

Lines changed: 39 additions & 35 deletions
Large diffs are not rendered by default.

pkg/controllers/tagging/tagging_controller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func init() {
4646
// workItem contains the node and an action for that node
4747
type workItem struct {
4848
node *v1.Node
49-
action func(node *v1.Node) error
49+
action func(ctx context.Context, node *v1.Node) error
5050
requeuingCount int
5151
enqueueTime time.Time
5252
}
@@ -189,7 +189,7 @@ func (tc *Controller) Run(ctx context.Context) {
189189
}
190190

191191
klog.Infof("Starting the tagging controller")
192-
go wait.Until(func() { tc.work(ctx) }, tc.nodeMonitorPeriod, stopCh)
192+
go wait.UntilWithContext(ctx, func(ctx context.Context) { tc.work(ctx) }, tc.nodeMonitorPeriod)
193193

194194
<-ctx.Done()
195195
}
@@ -241,7 +241,7 @@ func (tc *Controller) process(ctx context.Context) bool {
241241
return nil
242242
}
243243

244-
err = workItem.action(workItem.node)
244+
err = workItem.action(ctx, workItem.node)
245245

246246
if err != nil {
247247
if workItem.requeuingCount < maxRequeuingCount {
@@ -366,7 +366,7 @@ func (tc *Controller) untagEc2Instance(ctx context.Context, node *v1.Node) error
366366

367367
// enqueueNode takes in the object and an
368368
// action for the object for a workitem and enqueue to the workqueue
369-
func (tc *Controller) enqueueNode(node *v1.Node, action func(node *v1.Node) error) {
369+
func (tc *Controller) enqueueNode(node *v1.Node, action func(ctx context.Context, node *v1.Node) error) {
370370
item := &workItem{
371371
node: node,
372372
action: action,

0 commit comments

Comments
 (0)