Skip to content

Commit f077609

Browse files
committed
chore (deps) : bump controller-runtime to v0.18.7
Signed-off-by: Rohan Kumar <[email protected]>
1 parent efb5ad6 commit f077609

File tree

18 files changed

+204
-579
lines changed

18 files changed

+204
-579
lines changed

controllers/cleanupcronjob/cleanupcronjob_controller.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ import (
2020
"fmt"
2121
"time"
2222

23+
"sigs.k8s.io/controller-runtime/pkg/reconcile"
24+
25+
dwv2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
26+
controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
27+
"github.com/devfile/devworkspace-operator/pkg/conditions"
28+
"github.com/devfile/devworkspace-operator/pkg/config"
29+
"github.com/devfile/devworkspace-operator/pkg/infrastructure"
2330
"github.com/go-logr/logr"
2431
"k8s.io/apimachinery/pkg/runtime"
2532
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -28,13 +35,6 @@ import (
2835
"sigs.k8s.io/controller-runtime/pkg/event"
2936
"sigs.k8s.io/controller-runtime/pkg/handler"
3037
"sigs.k8s.io/controller-runtime/pkg/predicate"
31-
"sigs.k8s.io/controller-runtime/pkg/source"
32-
33-
dwv2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
34-
controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
35-
"github.com/devfile/devworkspace-operator/pkg/conditions"
36-
"github.com/devfile/devworkspace-operator/pkg/config"
37-
"github.com/devfile/devworkspace-operator/pkg/infrastructure"
3838

3939
"github.com/operator-framework/operator-lib/prune"
4040
"github.com/robfig/cron/v3"
@@ -123,10 +123,9 @@ func (r *CleanupCronJobReconciler) SetupWithManager(mgr ctrl.Manager) error {
123123

124124
return ctrl.NewControllerManagedBy(mgr).
125125
Named("CleanupCronJob").
126-
Watches(&source.Kind{Type: &controllerv1alpha1.DevWorkspaceOperatorConfig{}},
127-
handler.EnqueueRequestsFromMapFunc(func(object client.Object) []ctrl.Request {
126+
Watches(&controllerv1alpha1.DevWorkspaceOperatorConfig{},
127+
handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, object client.Object) []reconcile.Request {
128128
operatorNamespace, err := infrastructure.GetNamespace()
129-
130129
// Ignore events from other namespaces
131130
if err != nil || object.GetNamespace() != operatorNamespace || object.GetName() != config.OperatorConfigName {
132131
log.Info("Received event from different namespace, ignoring", "namespace", object.GetNamespace())

controllers/controller/devworkspacerouting/suite_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import (
2020
"path/filepath"
2121
"testing"
2222

23+
"sigs.k8s.io/controller-runtime/pkg/webhook"
24+
2325
dwv1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1"
2426
dwv2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
2527
controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
@@ -115,8 +117,10 @@ var _ = BeforeSuite(func() {
115117

116118
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
117119
Scheme: scheme.Scheme,
118-
Port: 9443,
119120
NewCache: cacheFunc,
121+
WebhookServer: webhook.NewServer(webhook.Options{
122+
Port: 9443,
123+
}),
120124
})
121125
Expect(err).NotTo(HaveOccurred())
122126

controllers/workspace/devworkspace_controller.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424

2525
"github.com/devfile/devworkspace-operator/pkg/library/ssh"
2626

27+
dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
2728
devfilevalidation "github.com/devfile/api/v2/pkg/validation"
2829
controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
2930
"github.com/devfile/devworkspace-operator/controllers/workspace/metrics"
@@ -34,6 +35,7 @@ import (
3435
"github.com/devfile/devworkspace-operator/pkg/dwerrors"
3536
"github.com/devfile/devworkspace-operator/pkg/library/annotate"
3637
containerlib "github.com/devfile/devworkspace-operator/pkg/library/container"
38+
wsDefaults "github.com/devfile/devworkspace-operator/pkg/library/defaults"
3739
"github.com/devfile/devworkspace-operator/pkg/library/env"
3840
"github.com/devfile/devworkspace-operator/pkg/library/flatten"
3941
"github.com/devfile/devworkspace-operator/pkg/library/home"
@@ -63,10 +65,6 @@ import (
6365
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
6466
"sigs.k8s.io/controller-runtime/pkg/handler"
6567
"sigs.k8s.io/controller-runtime/pkg/reconcile"
66-
"sigs.k8s.io/controller-runtime/pkg/source"
67-
68-
dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
69-
wsDefaults "github.com/devfile/devworkspace-operator/pkg/library/defaults"
7068
)
7169

7270
const (
@@ -701,7 +699,7 @@ func (r *DevWorkspaceReconciler) SetupWithManager(mgr ctrl.Manager) error {
701699
return err
702700
}
703701

704-
var emptyMapper = func(obj client.Object) []reconcile.Request {
702+
var emptyMapper = func(ctx context.Context, obj client.Object) []reconcile.Request {
705703
return []reconcile.Request{}
706704
}
707705

@@ -722,12 +720,12 @@ func (r *DevWorkspaceReconciler) SetupWithManager(mgr ctrl.Manager) error {
722720
Owns(&corev1.ConfigMap{}).
723721
Owns(&corev1.Secret{}).
724722
Owns(&corev1.ServiceAccount{}).
725-
Watches(&source.Kind{Type: &corev1.Pod{}}, handler.EnqueueRequestsFromMapFunc(dwRelatedPodsHandler)).
726-
Watches(&source.Kind{Type: &corev1.PersistentVolumeClaim{}}, handler.EnqueueRequestsFromMapFunc(r.dwPVCHandler)).
727-
Watches(&source.Kind{Type: &corev1.Secret{}}, handler.EnqueueRequestsFromMapFunc(r.runningWorkspacesHandler), automountWatcher).
728-
Watches(&source.Kind{Type: &corev1.ConfigMap{}}, handler.EnqueueRequestsFromMapFunc(r.runningWorkspacesHandler), automountWatcher).
729-
Watches(&source.Kind{Type: &corev1.PersistentVolumeClaim{}}, handler.EnqueueRequestsFromMapFunc(r.runningWorkspacesHandler), automountWatcher).
730-
Watches(&source.Kind{Type: &controllerv1alpha1.DevWorkspaceOperatorConfig{}}, handler.EnqueueRequestsFromMapFunc(emptyMapper), configWatcher).
723+
Watches(&corev1.Pod{}, handler.EnqueueRequestsFromMapFunc(dwRelatedPodsHandler)).
724+
Watches(&corev1.PersistentVolumeClaim{}, handler.EnqueueRequestsFromMapFunc(r.dwPVCHandler)).
725+
Watches(&corev1.Secret{}, handler.EnqueueRequestsFromMapFunc(r.runningWorkspacesHandler), automountWatcher).
726+
Watches(&corev1.ConfigMap{}, handler.EnqueueRequestsFromMapFunc(r.runningWorkspacesHandler), automountWatcher).
727+
Watches(&corev1.PersistentVolumeClaim{}, handler.EnqueueRequestsFromMapFunc(r.runningWorkspacesHandler), automountWatcher).
728+
Watches(&controllerv1alpha1.DevWorkspaceOperatorConfig{}, handler.EnqueueRequestsFromMapFunc(emptyMapper), configWatcher).
731729
WithEventFilter(devworkspacePredicates).
732730
WithEventFilter(podPredicates).
733731
Complete(r)

controllers/workspace/eventhandlers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
// Mapping the pod to the devworkspace
29-
func dwRelatedPodsHandler(obj client.Object) []reconcile.Request {
29+
func dwRelatedPodsHandler(ctx context.Context, obj client.Object) []reconcile.Request {
3030
labels := obj.GetLabels()
3131
if _, ok := labels[constants.DevWorkspaceNameLabel]; !ok {
3232
return []reconcile.Request{}
@@ -47,7 +47,7 @@ func dwRelatedPodsHandler(obj client.Object) []reconcile.Request {
4747
}
4848
}
4949

50-
func (r *DevWorkspaceReconciler) dwPVCHandler(obj client.Object) []reconcile.Request {
50+
func (r *DevWorkspaceReconciler) dwPVCHandler(ctx context.Context, obj client.Object) []reconcile.Request {
5151
if obj.GetDeletionTimestamp() == nil {
5252
// Do not reconcile unless PVC is being deleted.
5353
return []reconcile.Request{}
@@ -118,7 +118,7 @@ func (r *DevWorkspaceReconciler) dwPVCHandler(obj client.Object) []reconcile.Req
118118
return reconciles
119119
}
120120

121-
func (r *DevWorkspaceReconciler) runningWorkspacesHandler(obj client.Object) []reconcile.Request {
121+
func (r *DevWorkspaceReconciler) runningWorkspacesHandler(ctx context.Context, obj client.Object) []reconcile.Request {
122122
dwList := &dw.DevWorkspaceList{}
123123
if err := r.Client.List(context.Background(), dwList, &client.ListOptions{Namespace: obj.GetNamespace()}); err != nil {
124124
return []reconcile.Request{}

controllers/workspace/suite_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
"path/filepath"
2222
"testing"
2323

24+
"sigs.k8s.io/controller-runtime/pkg/webhook"
25+
2426
dwv1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1"
2527
dwv2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
2628
controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
@@ -117,8 +119,10 @@ var _ = BeforeSuite(func() {
117119

118120
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
119121
Scheme: scheme.Scheme,
120-
Port: 9443,
121122
NewCache: cacheFunc,
123+
WebhookServer: webhook.NewServer(webhook.Options{
124+
Port: 9443,
125+
}),
122126
})
123127
Expect(err).NotTo(HaveOccurred())
124128

go.mod

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ go 1.23.0
55
require (
66
github.com/devfile/api/v2 v2.2.2
77
github.com/go-git/go-git/v5 v5.13.0
8-
github.com/go-logr/logr v1.4.1
8+
github.com/go-logr/logr v1.4.2
99
github.com/google/go-cmp v0.6.0
1010
github.com/google/gofuzz v1.2.0
11-
github.com/google/uuid v1.1.2
11+
github.com/google/uuid v1.3.0
1212
github.com/kevinburke/ssh_config v1.2.0
1313
github.com/onsi/ginkgo/v2 v2.19.0
1414
github.com/onsi/gomega v1.34.1
1515
github.com/openshift/api v0.0.0-20200205133042-34f0ec8dab87
1616
github.com/operator-framework/operator-lib v0.11.0
17-
github.com/prometheus/client_golang v1.14.0
17+
github.com/prometheus/client_golang v1.16.0
1818
github.com/robfig/cron/v3 v3.0.0
1919
github.com/stretchr/testify v1.10.0
2020
golang.org/x/crypto v0.36.0
2121
golang.org/x/net v0.38.0
22-
k8s.io/api v0.26.1
23-
k8s.io/apiextensions-apiserver v0.26.1
24-
k8s.io/apimachinery v0.26.1
25-
k8s.io/client-go v0.26.1
26-
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
27-
sigs.k8s.io/controller-runtime v0.14.4
22+
k8s.io/api v0.30.1
23+
k8s.io/apiextensions-apiserver v0.30.1
24+
k8s.io/apimachinery v0.30.1
25+
k8s.io/client-go v0.30.1
26+
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
27+
sigs.k8s.io/controller-runtime v0.18.7
2828
sigs.k8s.io/yaml v1.3.0
2929
)
3030

@@ -33,26 +33,26 @@ require (
3333
github.com/Microsoft/go-winio v0.6.1 // indirect
3434
github.com/ProtonMail/go-crypto v1.1.3 // indirect
3535
github.com/beorn7/perks v1.0.1 // indirect
36-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
36+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
3737
github.com/cloudflare/circl v1.3.7 // indirect
3838
github.com/cyphar/filepath-securejoin v0.2.5 // indirect
3939
github.com/davecgh/go-spew v1.1.1 // indirect
40-
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
40+
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
4141
github.com/emirpasic/gods v1.18.1 // indirect
4242
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
43-
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
44-
github.com/fsnotify/fsnotify v1.6.0 // indirect
43+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
44+
github.com/fsnotify/fsnotify v1.7.0 // indirect
4545
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
4646
github.com/go-git/go-billy/v5 v5.6.0 // indirect
47-
github.com/go-logr/zapr v1.2.3 // indirect
48-
github.com/go-openapi/jsonpointer v0.19.5 // indirect
49-
github.com/go-openapi/jsonreference v0.20.0 // indirect
50-
github.com/go-openapi/swag v0.19.14 // indirect
47+
github.com/go-logr/zapr v1.3.0 // indirect
48+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
49+
github.com/go-openapi/jsonreference v0.20.2 // indirect
50+
github.com/go-openapi/swag v0.22.3 // indirect
5151
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
5252
github.com/gogo/protobuf v1.3.2 // indirect
5353
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
54-
github.com/golang/protobuf v1.5.3 // indirect
55-
github.com/google/gnostic v0.5.7-v3refs // indirect
54+
github.com/golang/protobuf v1.5.4 // indirect
55+
github.com/google/gnostic-models v0.6.8 // indirect
5656
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
5757
github.com/hashicorp/errwrap v1.0.0 // indirect
5858
github.com/hashicorp/go-multierror v1.1.1 // indirect
@@ -61,43 +61,41 @@ require (
6161
github.com/josharian/intern v1.0.0 // indirect
6262
github.com/json-iterator/go v1.1.12 // indirect
6363
github.com/mailru/easyjson v0.7.7 // indirect
64-
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
64+
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
6565
github.com/mitchellh/reflectwalk v1.0.1 // indirect
6666
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6767
github.com/modern-go/reflect2 v1.0.2 // indirect
6868
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
6969
github.com/pjbgf/sha1cd v0.3.0 // indirect
7070
github.com/pkg/errors v0.9.1 // indirect
7171
github.com/pmezard/go-difflib v1.0.0 // indirect
72-
github.com/prometheus/client_model v0.3.0 // indirect
73-
github.com/prometheus/common v0.37.0 // indirect
74-
github.com/prometheus/procfs v0.8.0 // indirect
72+
github.com/prometheus/client_model v0.4.0 // indirect
73+
github.com/prometheus/common v0.44.0 // indirect
74+
github.com/prometheus/procfs v0.12.0 // indirect
7575
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
7676
github.com/skeema/knownhosts v1.3.0 // indirect
7777
github.com/spf13/pflag v1.0.5 // indirect
7878
github.com/xanzy/ssh-agent v0.3.3 // indirect
79-
go.uber.org/atomic v1.7.0 // indirect
80-
go.uber.org/multierr v1.6.0 // indirect
81-
go.uber.org/zap v1.24.0 // indirect
79+
go.uber.org/multierr v1.11.0 // indirect
80+
go.uber.org/zap v1.26.0 // indirect
8281
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
8382
golang.org/x/mod v0.19.0 // indirect
84-
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
83+
golang.org/x/oauth2 v0.12.0 // indirect
8584
golang.org/x/sync v0.12.0 // indirect
8685
golang.org/x/sys v0.31.0 // indirect
8786
golang.org/x/term v0.30.0 // indirect
8887
golang.org/x/text v0.23.0 // indirect
8988
golang.org/x/time v0.3.0 // indirect
9089
golang.org/x/tools v0.23.0 // indirect
91-
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
90+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
9291
google.golang.org/appengine v1.6.7 // indirect
9392
google.golang.org/protobuf v1.34.1 // indirect
9493
gopkg.in/inf.v0 v0.9.1 // indirect
9594
gopkg.in/warnings.v0 v0.1.2 // indirect
9695
gopkg.in/yaml.v2 v2.4.0 // indirect
9796
gopkg.in/yaml.v3 v3.0.1 // indirect
98-
k8s.io/component-base v0.26.1 // indirect
99-
k8s.io/klog/v2 v2.80.1 // indirect
100-
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
101-
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
102-
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
97+
k8s.io/klog/v2 v2.120.1 // indirect
98+
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
99+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
100+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
103101
)

0 commit comments

Comments
 (0)