Skip to content

Commit 53b4886

Browse files
committed
chore: bump controller runtime
update controller runtime to 0.18
1 parent ee1c42c commit 53b4886

File tree

5 files changed

+60
-63
lines changed

5 files changed

+60
-63
lines changed

cmd/main.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,15 @@ func run() error {
193193
}
194194

195195
if config.Config.Operator.RunnerReconciliation {
196-
runnerEvents := make(chan event.GenericEvent)
196+
197197
runnerReconciler := &garmcontroller.RunnerReconciler{
198-
Client: mgr.GetClient(),
199-
Scheme: mgr.GetScheme(),
198+
Client: mgr.GetClient(),
199+
Scheme: mgr.GetScheme(),
200+
ReconcileChan: make(chan event.GenericEvent),
200201
}
201202

202203
// setup controller so it can reconcile if events from runnerEvents are queued
203-
if err = runnerReconciler.SetupWithManager(mgr, runnerEvents,
204+
if err = runnerReconciler.SetupWithManager(mgr,
204205
controller.Options{
205206
MaxConcurrentReconciles: config.Config.Operator.RunnerConcurrency,
206207
},
@@ -210,7 +211,7 @@ func run() error {
210211

211212
// fetch runner instances periodically and enqueue reconcile events for runner ctrl if external system has changed
212213
ctx, cancel := context.WithCancel(ctx)
213-
go runnerReconciler.PollRunnerInstances(ctx, runnerEvents)
214+
go runnerReconciler.PollRunnerInstances(ctx)
214215
defer cancel()
215216
}
216217

go.mod

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ require (
2323
go.uber.org/mock v0.5.2
2424
golang.org/x/mod v0.24.0
2525
gopkg.in/yaml.v2 v2.4.0
26-
k8s.io/api v0.29.15
27-
k8s.io/apimachinery v0.29.15
28-
k8s.io/client-go v0.29.15
26+
k8s.io/api v0.30.1
27+
k8s.io/apimachinery v0.30.1
28+
k8s.io/client-go v0.30.1
2929
k8s.io/klog/v2 v2.120.1
3030
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
31-
sigs.k8s.io/controller-runtime v0.17.6
31+
sigs.k8s.io/controller-runtime v0.18.7
3232
)
3333

3434
require (
@@ -40,11 +40,11 @@ require (
4040
github.com/davecgh/go-spew v1.1.1 // indirect
4141
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
4242
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
43-
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
43+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
4444
github.com/felixge/httpsnoop v1.0.4 // indirect
4545
github.com/fsnotify/fsnotify v1.9.0 // indirect
4646
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
47-
github.com/go-logr/logr v1.4.1 // indirect
47+
github.com/go-logr/logr v1.4.2 // indirect
4848
github.com/go-logr/stdr v1.2.2 // indirect
4949
github.com/go-openapi/analysis v0.23.0 // indirect
5050
github.com/go-openapi/errors v0.22.0 // indirect
@@ -107,9 +107,8 @@ require (
107107
gopkg.in/inf.v0 v0.9.1 // indirect
108108
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
109109
gopkg.in/yaml.v3 v3.0.1 // indirect
110-
k8s.io/apiextensions-apiserver v0.29.2 // indirect
111-
k8s.io/component-base v0.29.2 // indirect
112-
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
110+
k8s.io/apiextensions-apiserver v0.30.1 // indirect
111+
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
113112
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
114113
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
115114
sigs.k8s.io/yaml v1.4.0 // indirect

go.sum

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER
1919
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
2020
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
2121
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
22-
github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro=
23-
github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
22+
github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
23+
github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
2424
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
2525
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
2626
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
2727
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
2828
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
2929
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
3030
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
31-
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
32-
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
31+
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
32+
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
3333
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
3434
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
3535
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
@@ -150,10 +150,10 @@ github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6Fx
150150
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8=
151151
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
152152
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
153-
github.com/onsi/ginkgo/v2 v2.14.0 h1:vSmGj2Z5YPb9JwCWT6z6ihcUvDhuXLc3sJiqd3jMKAY=
154-
github.com/onsi/ginkgo/v2 v2.14.0/go.mod h1:JkUdW7JkN0V6rFvsHcJ478egV3XH9NxpD27Hal/PhZw=
155-
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
156-
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
153+
github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8=
154+
github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs=
155+
github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk=
156+
github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg=
157157
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
158158
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
159159
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -263,24 +263,22 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
263263
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
264264
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
265265
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
266-
k8s.io/api v0.29.15 h1:QxPcAheYujeBwkdiE0vMyKkAtqUq5YNyXVqimT+me44=
267-
k8s.io/api v0.29.15/go.mod h1:16duIp2ez6GiLPq1g8XtZNIkw6hJpIitpxZSvv0dZ6E=
268-
k8s.io/apiextensions-apiserver v0.29.2 h1:UK3xB5lOWSnhaCk0RFZ0LUacPZz9RY4wi/yt2Iu+btg=
269-
k8s.io/apiextensions-apiserver v0.29.2/go.mod h1:aLfYjpA5p3OwtqNXQFkhJ56TB+spV8Gc4wfMhUA3/b8=
270-
k8s.io/apimachinery v0.29.15 h1:aLc0wghElkdnTO7TMVTxTrifoXah1lqRL8s6szDHGbg=
271-
k8s.io/apimachinery v0.29.15/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y=
272-
k8s.io/client-go v0.29.15 h1:zCBOXKCtz9Hl8boKUGs8zbtZEP6pc7O8Ov3ma+gnS6o=
273-
k8s.io/client-go v0.29.15/go.mod h1:xPy0D3p4sonPhZhI3QoYo4m7oLKoPjFf4vYF9oxoxNM=
274-
k8s.io/component-base v0.29.2 h1:lpiLyuvPA9yV1aQwGLENYyK7n/8t6l3nn3zAtFTJYe8=
275-
k8s.io/component-base v0.29.2/go.mod h1:BfB3SLrefbZXiBfbM+2H1dlat21Uewg/5qtKOl8degM=
266+
k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY=
267+
k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM=
268+
k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws=
269+
k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4=
270+
k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U=
271+
k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
272+
k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q=
273+
k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc=
276274
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
277275
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
278-
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
279-
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
276+
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
277+
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
280278
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
281279
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
282-
sigs.k8s.io/controller-runtime v0.17.6 h1:12IXsozEsIXWAMRpgRlYS1jjAHQXHtWEOMdULh3DbEw=
283-
sigs.k8s.io/controller-runtime v0.17.6/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY=
280+
sigs.k8s.io/controller-runtime v0.18.7 h1:WDnx8LTRY8Fn1j/7B+S/R9MeDjWNAzpDBoaSvMSrQME=
281+
sigs.k8s.io/controller-runtime v0.18.7/go.mod h1:L9r3fUZhID7Q9eK9mseNskpaTg2n11f/tlb8odyzJ4Y=
284282
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
285283
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
286284
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=

internal/controller/runner_controller.go

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ import (
3535
// RunnerReconciler reconciles a Runner object
3636
type RunnerReconciler struct {
3737
client.Client
38-
Scheme *runtime.Scheme
39-
Recorder record.EventRecorder
38+
Scheme *runtime.Scheme
39+
Recorder record.EventRecorder
40+
ReconcileChan chan event.GenericEvent
4041
}
4142

4243
//+kubebuilder:rbac:groups=garm-operator.mercedes-benz.com,namespace=xxxxx,resources=runners,verbs=get;list;watch;create;update;patch;delete
@@ -192,38 +193,34 @@ func (r *RunnerReconciler) updateRunnerStatus(ctx context.Context, runner *garmo
192193
}
193194

194195
// SetupWithManager sets up the controller with the Manager.
195-
func (r *RunnerReconciler) SetupWithManager(mgr ctrl.Manager, eventChan chan event.GenericEvent, options controller.Options) error {
196-
c, err := ctrl.NewControllerManagedBy(mgr).
196+
func (r *RunnerReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error {
197+
return ctrl.NewControllerManagedBy(mgr).
197198
For(&garmoperatorv1beta1.Runner{}).
198199
WithOptions(options).
199-
Build(r)
200-
if err != nil {
201-
return err
202-
}
203-
204-
return c.Watch(&source.Channel{Source: eventChan}, &handler.EnqueueRequestForObject{})
200+
WatchesRawSource(source.Channel(r.ReconcileChan, &handler.EnqueueRequestForObject{})).
201+
Complete(r)
205202
}
206203

207-
func (r *RunnerReconciler) PollRunnerInstances(ctx context.Context, eventChan chan event.GenericEvent) {
204+
func (r *RunnerReconciler) PollRunnerInstances(ctx context.Context) {
208205
log := log.FromContext(ctx)
209206
ticker := time.NewTicker(config.Config.Operator.SyncRunnersInterval)
210207
for {
211208
select {
212209
case <-ctx.Done():
213210
log.Info("Closing event channel for runners...")
214-
close(eventChan)
211+
close(r.ReconcileChan)
215212
return
216213
case <-ticker.C:
217214
instanceClient := garmClient.NewInstanceClient()
218-
err := r.EnqueueRunnerInstances(ctx, instanceClient, eventChan)
215+
err := r.EnqueueRunnerInstances(ctx, instanceClient)
219216
if err != nil {
220217
log.Error(err, "Failed polling runner instances")
221218
}
222219
}
223220
}
224221
}
225222

226-
func (r *RunnerReconciler) EnqueueRunnerInstances(ctx context.Context, instanceClient garmClient.InstanceClient, eventChan chan event.GenericEvent) error {
223+
func (r *RunnerReconciler) EnqueueRunnerInstances(ctx context.Context, instanceClient garmClient.InstanceClient) error {
227224
pools, err := r.fetchPools(ctx)
228225
if err != nil {
229226
return err
@@ -242,11 +239,11 @@ func (r *RunnerReconciler) EnqueueRunnerInstances(ctx context.Context, instanceC
242239
}
243240

244241
// triggers controller to reconcile based on instances in garm db
245-
enqeueRunnerEvents(garmRunnerInstances, eventChan)
242+
r.enqeueRunnerEvents(garmRunnerInstances)
246243
return nil
247244
}
248245

249-
func enqeueRunnerEvents(garmRunnerInstances params.Instances, eventChan chan event.GenericEvent) {
246+
func (r *RunnerReconciler) enqeueRunnerEvents(garmRunnerInstances params.Instances) {
250247
for _, runner := range garmRunnerInstances {
251248
runnerObj := garmoperatorv1beta1.Runner{
252249
ObjectMeta: metav1.ObjectMeta{
@@ -259,7 +256,7 @@ func enqeueRunnerEvents(garmRunnerInstances params.Instances, eventChan chan eve
259256
Object: &runnerObj,
260257
}
261258

262-
eventChan <- e
259+
r.ReconcileChan <- e
263260
}
264261
}
265262

internal/controller/runner_controller_test.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ func TestRunnerReconciler_reconcileCreate(t *testing.T) {
109109

110110
// create a fake reconciler
111111
reconciler := &RunnerReconciler{
112-
Client: client,
113-
Recorder: record.NewFakeRecorder(3),
112+
Client: client,
113+
Recorder: record.NewFakeRecorder(3),
114+
ReconcileChan: make(chan event.GenericEvent, 1),
114115
}
115116

116117
mockInstanceClient := mock.NewMockInstanceClient(mockCtrl)
@@ -252,8 +253,9 @@ func TestRunnerReconciler_reconcileDeleteGarmRunner(t *testing.T) {
252253

253254
// create a fake reconciler
254255
reconciler := &RunnerReconciler{
255-
Client: client,
256-
Recorder: record.NewFakeRecorder(3),
256+
Client: client,
257+
Recorder: record.NewFakeRecorder(3),
258+
ReconcileChan: make(chan event.GenericEvent, 1),
257259
}
258260

259261
mockInstanceClient := mock.NewMockInstanceClient(mockCtrl)
@@ -427,28 +429,28 @@ func TestRunnerReconciler_reconcileDeleteCR(t *testing.T) {
427429

428430
// create a fake reconciler
429431
reconciler := &RunnerReconciler{
430-
Client: client,
431-
Recorder: record.NewFakeRecorder(3),
432+
Client: client,
433+
Recorder: record.NewFakeRecorder(3),
434+
ReconcileChan: make(chan event.GenericEvent, 1),
432435
}
433436

434437
mockInstanceClient := mock.NewMockInstanceClient(mockCtrl)
435438
tt.expectGarmRequest(mockInstanceClient.EXPECT())
436439

437440
config.Config.Operator.WatchNamespace = "test-namespace"
438-
fakeChan := make(chan event.GenericEvent)
439441

440442
go func() {
441-
err = reconciler.EnqueueRunnerInstances(context.Background(), mockInstanceClient, fakeChan)
443+
err = reconciler.EnqueueRunnerInstances(context.Background(), mockInstanceClient)
442444
if (err != nil) != tt.wantErr {
443445
t.Errorf("RunnerReconciler.EnqueueRunnerInstances() error = %v, wantErr %v", err, tt.wantErr)
444446
return
445447
}
446-
close(fakeChan)
448+
close(reconciler.ReconcileChan)
447449
}()
448450

449451
// receive events in fake channel and compare if expected event occurs by filtering received events in fake channel by expected event
450452
var eventCount int
451-
for obj := range fakeChan {
453+
for obj := range reconciler.ReconcileChan {
452454
t.Logf("Received Event: %s", obj.Object.GetName())
453455

454456
filtered := slices.CompactFunc(tt.expectedEvents, func(i, j event.GenericEvent) bool {

0 commit comments

Comments
 (0)