Skip to content

Commit f57a7f4

Browse files
Bump k8s go libraries to v0.29.4 (#746)
1 parent 1aa9493 commit f57a7f4

18 files changed

+257
-471
lines changed

.github/workflows/bundle-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ jobs:
4242
username: ${{ secrets.DOCKER_USER }}
4343
password: ${{ secrets.DOCKER_PASSWORD }}
4444

45-
- name: Set up GO 1.21.8
45+
- name: Set up GO 1.22.2
4646
uses: actions/setup-go@v1
4747
with:
48-
go-version: 1.21.8
48+
go-version: 1.22.2
4949
id: go
5050

5151
- name: InstallKubebuilder
@@ -166,10 +166,10 @@ jobs:
166166
username: ${{ secrets.DOCKER_USER }}
167167
password: ${{ secrets.DOCKER_PASSWORD }}
168168

169-
- name: Set up GO 1.21.8
169+
- name: Set up GO 1.22.2
170170
uses: actions/setup-go@v1
171171
with:
172-
go-version: 1.21.8
172+
go-version: 1.22.2
173173
id: go
174174

175175
- name: InstallKubebuilder

.github/workflows/olm-verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
- name: checkout
2828
uses: actions/checkout@v2
2929

30-
- name: Set up GO 1.21.8
30+
- name: Set up GO 1.22.2
3131
uses: actions/setup-go@v1
3232
with:
33-
go-version: 1.21.8
33+
go-version: 1.22.2
3434
id: go
3535

3636
- name: InstallKubebuilder

.github/workflows/project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
go-version: [1.19, 1.20.4]
21+
go-version: [1.21.9, 1.22.2]
2222
steps:
2323
- name: clean disk
2424
run: |
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: InstallTool
4646
run: |
47-
wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.52.2
47+
wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.57.2
4848
./bin/golangci-lint --version
4949
5050
- name: validate controller-gen

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
username: ${{ secrets.DOCKER_USER }}
3131
password: ${{ secrets.DOCKER_PASSWORD }}
3232

33-
- name: Set up GO 1.21.8
33+
- name: Set up GO 1.22.2
3434
uses: actions/setup-go@v1
3535
with:
36-
go-version: 1.21.8
36+
go-version: 1.22.2
3737
id: go
3838

3939
- name: InstallKubebuilder

.github/workflows/test-helm-charts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ jobs:
7676
run: hack/kind-cluster-build.sh --name chart-testing -c 1 -v 10 --k8sVersion v1.23.17
7777
if: steps.list-changed.outputs.changed == 'true'
7878

79-
- name: Set up GO 1.21.8
79+
- name: Set up GO 1.22.2
8080
if: steps.list-changed.outputs.changed == 'true'
8181
uses: actions/setup-go@v1
8282
with:
83-
go-version: 1.21.8
83+
go-version: 1.22.2
8484
id: go
8585

8686
- name: setup kubebuilder 3.6.0

.github/workflows/trivy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
repository: ${{github.event.pull_request.head.repo.full_name}}
2424
ref: ${{ github.event.pull_request.head.sha }}
2525

26-
- name: Set up GO 1.21.8
26+
- name: Set up GO 1.22.2
2727
uses: actions/setup-go@v1
2828
with:
29-
go-version: 1.21.8
29+
go-version: 1.22.2
3030
id: go
3131

3232
- name: InstallKubebuilder

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ image-push:
130130
# find or download controller-gen
131131
# download controller-gen if necessary
132132
controller-gen:
133-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.2)
133+
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0)
134134

135135
kustomize: ## Download kustomize locally if necessary.
136136
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.5)

controllers/function_controller.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ import (
2222
"time"
2323

2424
"github.com/streamnative/function-mesh/pkg/monitoring"
25-
"k8s.io/apimachinery/pkg/types"
26-
"sigs.k8s.io/controller-runtime/pkg/handler"
27-
"sigs.k8s.io/controller-runtime/pkg/source"
28-
2925
v1 "k8s.io/api/batch/v1"
26+
"k8s.io/apimachinery/pkg/types"
3027
"k8s.io/client-go/rest"
28+
"sigs.k8s.io/controller-runtime/pkg/handler"
3129

3230
"github.com/go-logr/logr"
3331
"github.com/streamnative/function-mesh/api/compute/v1alpha1"
@@ -188,8 +186,8 @@ func (r *FunctionReconciler) SetupWithManager(mgr ctrl.Manager) error {
188186
Owns(&corev1.Secret{}).
189187
Owns(&v1.Job{})
190188

191-
manager.Watches(&source.Kind{Type: &v1alpha1.BackendConfig{}}, handler.EnqueueRequestsFromMapFunc(
192-
func(object client.Object) []reconcile.Request {
189+
manager.Watches(&v1alpha1.BackendConfig{}, handler.EnqueueRequestsFromMapFunc(
190+
func(ctx context.Context, object client.Object) []reconcile.Request {
193191
if object.GetName() == utils.GlobalBackendConfig && object.GetNamespace() == utils.GlobalBackendConfigNamespace {
194192
ctx := context.Background()
195193
functions := &v1alpha1.FunctionList{}

controllers/sink_controller.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ import (
2222
"time"
2323

2424
"github.com/streamnative/function-mesh/pkg/monitoring"
25-
"k8s.io/apimachinery/pkg/types"
26-
"sigs.k8s.io/controller-runtime/pkg/handler"
27-
"sigs.k8s.io/controller-runtime/pkg/source"
28-
2925
v1 "k8s.io/api/batch/v1"
26+
"k8s.io/apimachinery/pkg/types"
3027
"k8s.io/client-go/rest"
28+
"sigs.k8s.io/controller-runtime/pkg/handler"
3129

3230
"github.com/go-logr/logr"
3331
"github.com/streamnative/function-mesh/api/compute/v1alpha1"
@@ -193,8 +191,8 @@ func (r *SinkReconciler) SetupWithManager(mgr ctrl.Manager) error {
193191
AddControllerBuilderOwn(manager, r.GroupVersionFlags.APIAutoscalingGroupVersion)
194192
}
195193

196-
manager.Watches(&source.Kind{Type: &v1alpha1.BackendConfig{}}, handler.EnqueueRequestsFromMapFunc(
197-
func(object client.Object) []reconcile.Request {
194+
manager.Watches(&v1alpha1.BackendConfig{}, handler.EnqueueRequestsFromMapFunc(
195+
func(ctx context.Context, object client.Object) []reconcile.Request {
198196
if object.GetName() == utils.GlobalBackendConfig && object.GetNamespace() == utils.GlobalBackendConfigNamespace {
199197
ctx := context.Background()
200198
sinks := &v1alpha1.SinkList{}

controllers/source_controller.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,23 @@ import (
2121
"context"
2222
"time"
2323

24-
"github.com/streamnative/function-mesh/pkg/monitoring"
25-
"k8s.io/apimachinery/pkg/types"
26-
"sigs.k8s.io/controller-runtime/pkg/handler"
27-
k8ssource "sigs.k8s.io/controller-runtime/pkg/source"
28-
2924
"github.com/go-logr/logr"
3025
"github.com/streamnative/function-mesh/api/compute/v1alpha1"
3126
"github.com/streamnative/function-mesh/controllers/spec"
27+
"github.com/streamnative/function-mesh/pkg/monitoring"
3228
"github.com/streamnative/function-mesh/utils"
3329
appsv1 "k8s.io/api/apps/v1"
3430
v1 "k8s.io/api/batch/v1"
3531
corev1 "k8s.io/api/core/v1"
3632
"k8s.io/apimachinery/pkg/api/errors"
3733
"k8s.io/apimachinery/pkg/runtime"
34+
"k8s.io/apimachinery/pkg/types"
3835
vpav1 "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1"
3936
"k8s.io/client-go/rest"
4037
ctrl "sigs.k8s.io/controller-runtime"
4138
"sigs.k8s.io/controller-runtime/pkg/builder"
4239
"sigs.k8s.io/controller-runtime/pkg/client"
40+
"sigs.k8s.io/controller-runtime/pkg/handler"
4341
"sigs.k8s.io/controller-runtime/pkg/predicate"
4442
"sigs.k8s.io/controller-runtime/pkg/reconcile"
4543
)
@@ -191,10 +189,9 @@ func (r *SourceReconciler) SetupWithManager(mgr ctrl.Manager) error {
191189
if r.GroupVersionFlags != nil && r.GroupVersionFlags.APIAutoscalingGroupVersion != "" {
192190
AddControllerBuilderOwn(manager, r.GroupVersionFlags.APIAutoscalingGroupVersion)
193191
}
194-
manager.Watches(&k8ssource.Kind{Type: &v1alpha1.BackendConfig{}}, handler.EnqueueRequestsFromMapFunc(
195-
func(object client.Object) []reconcile.Request {
192+
manager.Watches(&v1alpha1.BackendConfig{}, handler.EnqueueRequestsFromMapFunc(
193+
func(ctx context.Context, object client.Object) []reconcile.Request {
196194
if object.GetName() == utils.GlobalBackendConfig && object.GetNamespace() == utils.GlobalBackendConfigNamespace {
197-
ctx := context.Background()
198195
sources := &v1alpha1.SourceList{}
199196
err := mgr.GetClient().List(ctx, sources)
200197
if err != nil {

0 commit comments

Comments
 (0)