Skip to content

Commit 2b17282

Browse files
authored
chore(go): bumping up to go1.23 (#643)
* chore(go): bumping up to go1.23 Signed-off-by: Dario Tranchitella <[email protected]> * chore(golangci-lint): bumping up to v1.62.2 Signed-off-by: Dario Tranchitella <[email protected]> --------- Signed-off-by: Dario Tranchitella <[email protected]>
1 parent 1c8c67b commit 2b17282

31 files changed

+59
-60
lines changed

.github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Run golangci-lint
1919
uses: golangci/[email protected]
2020
with:
21-
version: v1.54.2
21+
version: v1.62.2
2222
only-new-issues: false
2323
args: --timeout 5m --config .golangci.yml
2424
diff:

.golangci.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
linters-settings:
2+
revive:
3+
rules:
4+
- name: dot-imports
5+
arguments:
6+
- allowedPackages:
7+
- "github.com/onsi/ginkgo/v2"
8+
- "github.com/onsi/gomega"
29
gci:
310
sections:
411
- standard
@@ -13,16 +20,14 @@ linters:
1320
disable:
1421
- depguard
1522
- wrapcheck
16-
- gomnd
17-
- scopelint
23+
- mnd
1824
- varnamelen
1925
- testpackage
2026
- tagliatelle
2127
- paralleltest
2228
- ireturn
23-
- goerr113
29+
- err113
2430
- gochecknoglobals
25-
- exhaustivestruct
2631
- wsl
2732
- exhaustive
2833
- nosprintfhostport
@@ -39,13 +44,7 @@ linters:
3944
- cyclop
4045
- gocognit
4146
- nestif
47+
- perfsprint
4248
# deprecated linters
43-
- deadcode
44-
- golint
45-
- interfacer
46-
- structcheck
47-
- varcheck
48-
- nosnakecase
49-
- ifshort
50-
- maligned
49+
- exportloopref
5150
enable-all: true

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
103103
.PHONY: golangci-lint
104104
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
105105
$(GOLANGCI_LINT): $(LOCALBIN)
106-
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2
106+
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
107107

108108
.PHONY: apidocs-gen
109109
apidocs-gen: $(APIDOCS_GEN) ## Download crdoc locally if necessary.

api/v1alpha1/suite_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright 2022 Clastix Labs
22
// SPDX-License-Identifier: Apache-2.0
3+
34
package v1alpha1
45

56
import (

api/v1alpha1/tenantcontrolplane_interfaces.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ package v1alpha1
88
// +kubebuilder:object:generate=false
99
type KubeadmConfigChecksumDependant interface {
1010
GetChecksum() string
11-
SetChecksum(string)
11+
SetChecksum(checksum string)
1212
}

api/v1alpha1/tenantcontrolplane_kubeadmphase_funcs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
88
)
99

10-
func (in KubeadmPhaseStatus) GetChecksum() string {
10+
func (in *KubeadmPhaseStatus) GetChecksum() string {
1111
return in.Checksum
1212
}
1313

api/v1alpha1/tenantcontrolplane_types_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var _ = Describe("Cluster controller", func() {
1919
)
2020

2121
BeforeEach(func() {
22-
ctx = context.Background()
22+
ctx = context.Background() //nolint:fatcontext
2323
tcp = &TenantControlPlane{
2424
ObjectMeta: metav1.ObjectMeta{
2525
Name: "tcp",

cmd/manager/cmd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command {
6868
Short: "Start the Kamaji Kubernetes Operator",
6969
SilenceErrors: false,
7070
SilenceUsage: true,
71-
PreRunE: func(cmd *cobra.Command, args []string) (err error) {
71+
PreRunE: func(cmd *cobra.Command, _ []string) (err error) {
7272
// Avoid to pollute Kamaji stdout with useless details by the underlying klog implementations
7373
klog.SetOutput(io.Discard)
7474
klog.LogToStderr(false)
@@ -95,7 +95,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command {
9595

9696
return nil
9797
},
98-
RunE: func(cmd *cobra.Command, args []string) error {
98+
RunE: func(*cobra.Command, []string) error {
9999
setupLog := ctrl.Log.WithName("setup")
100100

101101
setupLog.Info(fmt.Sprintf("Kamaji version %s %s%s", internal.GitTag, internal.GitCommit, internal.GitDirty))

cmd/migrate/cmd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command {
3131
Use: "migrate",
3232
Short: "Migrate the data of a TenantControlPlane to another compatible DataStore",
3333
SilenceUsage: true,
34-
RunE: func(cmd *cobra.Command, args []string) error {
34+
RunE: func(*cobra.Command, []string) error {
3535
ctx, cancelFn := context.WithTimeout(context.Background(), timeout)
3636
defer cancelFn()
3737

cmd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command {
1818
return &cobra.Command{
1919
Use: "kamaji",
2020
Short: "Build and operate Kubernetes at scale with a fraction of operational burden.",
21-
PersistentPreRun: func(cmd *cobra.Command, args []string) {
21+
PersistentPreRun: func(*cobra.Command, []string) {
2222
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
2323
utilruntime.Must(kamajiv1alpha1.AddToScheme(scheme))
2424
utilruntime.Must(appsv1.RegisterDefaults(scheme))

controllers/datastore_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (r *DataStore) SetupWithManager(mgr controllerruntime.Manager) error {
101101
CreateFunc: func(_ context.Context, createEvent event.TypedCreateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request]) {
102102
enqueueFn(createEvent.Object.(*kamajiv1alpha1.TenantControlPlane), w)
103103
},
104-
UpdateFunc: func(ctx context.Context, updateEvent event.TypedUpdateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request]) {
104+
UpdateFunc: func(_ context.Context, updateEvent event.TypedUpdateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request]) {
105105
enqueueFn(updateEvent.ObjectOld.(*kamajiv1alpha1.TenantControlPlane), w)
106106
enqueueFn(updateEvent.ObjectNew.(*kamajiv1alpha1.TenantControlPlane), w)
107107
},

controllers/soot/manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (m *Manager) Reconcile(ctx context.Context, request reconcile.Request) (res
182182
Metrics: metricsserver.Options{
183183
BindAddress: "0",
184184
},
185-
NewClient: func(config *rest.Config, options client.Options) (client.Client, error) {
185+
NewClient: func(config *rest.Config, _ client.Options) (client.Client, error) {
186186
return client.New(config, client.Options{
187187
Scheme: m.client.Scheme(),
188188
})

e2e/tcp_additional_resources_ready_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2022 Clastix Labs
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//nolint:ginkgolinter
45
package e2e
56

67
import (

go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/clastix/kamaji
22

3-
go 1.22.0
4-
5-
toolchain go1.22.1
3+
go 1.23
64

75
require (
86
github.com/JamesStewy/go-mysqldump v0.2.2

internal/resources/datastore/datastore_storage_config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var _ = Describe("DatastoreStorageConfig", func() {
2828
)
2929

3030
BeforeEach(func() {
31-
ctx = context.Background()
31+
ctx = context.Background() //nolint:fatcontext
3232

3333
tcp = &kamajiv1alpha1.TenantControlPlane{
3434
ObjectMeta: metav1.ObjectMeta{

internal/resources/konnectivity/service_resource.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (r *ServiceResource) ShouldStatusBeUpdated(_ context.Context, tenantControl
4646
return true
4747
}
4848

49-
for i := 0; i < len(resourceIngresses); i++ {
49+
for i := range resourceIngresses {
5050
if resourceIngresses[i].Hostname != statusIngresses[i].Hostname ||
5151
resourceIngresses[i].IP != statusIngresses[i].IP ||
5252
len(resourceIngresses[i].Ports) != len(statusIngresses[i].Ports) {
@@ -55,7 +55,7 @@ func (r *ServiceResource) ShouldStatusBeUpdated(_ context.Context, tenantControl
5555

5656
resourcePorts := resourceIngresses[i].Ports
5757
statusPorts := statusIngresses[i].Ports
58-
for j := 0; j < len(resourcePorts); j++ {
58+
for j := range resourcePorts {
5959
if resourcePorts[j].Port != statusPorts[j].Port ||
6060
resourcePorts[j].Protocol != statusPorts[j].Protocol {
6161
return true

internal/resources/kubeadm_phases.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (r *KubeadmPhase) UpdateTenantControlPlaneStatus(ctx context.Context, tenan
229229
func (r *KubeadmPhase) GetStatus(tenantControlPlane *kamajiv1alpha1.TenantControlPlane) (kamajiv1alpha1.KubeadmConfigChecksumDependant, error) {
230230
switch r.Phase {
231231
case PhaseUploadConfigKubeadm, PhaseUploadConfigKubelet, PhaseClusterAdminRBAC:
232-
return nil, nil
232+
return nil, nil //nolint:nilnil
233233
case PhaseBootstrapToken:
234234
return &tenantControlPlane.Status.KubeadmPhase.BootstrapToken, nil
235235
default:

internal/resources/resource.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ const (
2121
)
2222

2323
type Resource interface {
24-
Define(context.Context, *kamajiv1alpha1.TenantControlPlane) error
25-
ShouldCleanup(*kamajiv1alpha1.TenantControlPlane) bool
26-
CleanUp(context.Context, *kamajiv1alpha1.TenantControlPlane) (bool, error)
27-
CreateOrUpdate(context.Context, *kamajiv1alpha1.TenantControlPlane) (controllerutil.OperationResult, error)
24+
Define(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) error
25+
ShouldCleanup(tcp *kamajiv1alpha1.TenantControlPlane) bool
26+
CleanUp(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) (bool, error)
27+
CreateOrUpdate(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) (controllerutil.OperationResult, error)
2828
GetName() string
29-
ShouldStatusBeUpdated(context.Context, *kamajiv1alpha1.TenantControlPlane) bool
30-
UpdateTenantControlPlaneStatus(context.Context, *kamajiv1alpha1.TenantControlPlane) error
29+
ShouldStatusBeUpdated(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) bool
30+
UpdateTenantControlPlaneStatus(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) error
3131
}
3232

3333
type DeletableResource interface {
3434
GetName() string
35-
Define(context.Context, *kamajiv1alpha1.TenantControlPlane) error
36-
Delete(context.Context, *kamajiv1alpha1.TenantControlPlane) error
35+
Define(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) error
36+
Delete(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) error
3737
}
3838

3939
type KubeadmResource interface {
@@ -45,9 +45,9 @@ type KubeadmPhaseResource interface {
4545
Resource
4646
KubeadmResource
4747
GetClient() client.Client
48-
GetKubeadmFunction(context.Context, *kamajiv1alpha1.TenantControlPlane) (func(clientset.Interface, *kubeadm.Configuration) ([]byte, error), error)
49-
GetStatus(*kamajiv1alpha1.TenantControlPlane) (kamajiv1alpha1.KubeadmConfigChecksumDependant, error)
50-
SetKubeadmConfigChecksum(string)
48+
GetKubeadmFunction(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) (func(clientset.Interface, *kubeadm.Configuration) ([]byte, error), error)
49+
GetStatus(tcp *kamajiv1alpha1.TenantControlPlane) (kamajiv1alpha1.KubeadmConfigChecksumDependant, error)
50+
SetKubeadmConfigChecksum(checksum string)
5151
GetWatchedObject() client.Object
5252
GetPredicateFunc() func(obj client.Object) bool
5353
}

internal/webhook/handlers/ds_secrets.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (d DataStoreSecretValidation) OnDelete(runtime.Object) AdmissionResponse {
3333
}
3434

3535
func (d DataStoreSecretValidation) OnUpdate(object runtime.Object, _ runtime.Object) AdmissionResponse {
36-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
36+
return func(ctx context.Context, _ admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
3737
secret := object.(*corev1.Secret) //nolint:forcetypeassert
3838

3939
dsList := &kamajiv1alpha1.DataStoreList{}

internal/webhook/handlers/ds_validate.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ type DataStoreValidation struct {
2525
}
2626

2727
func (d DataStoreValidation) OnCreate(object runtime.Object) AdmissionResponse {
28-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
28+
return func(ctx context.Context, _ admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
2929
ds := object.(*kamajiv1alpha1.DataStore) //nolint:forcetypeassert
3030

3131
return nil, d.validate(ctx, *ds)
3232
}
3333
}
3434

3535
func (d DataStoreValidation) OnDelete(object runtime.Object) AdmissionResponse {
36-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
36+
return func(ctx context.Context, _ admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
3737
ds := object.(*kamajiv1alpha1.DataStore) //nolint:forcetypeassert
3838

3939
tcpList := &kamajiv1alpha1.TenantControlPlaneList{}
@@ -50,7 +50,7 @@ func (d DataStoreValidation) OnDelete(object runtime.Object) AdmissionResponse {
5050
}
5151

5252
func (d DataStoreValidation) OnUpdate(object runtime.Object, oldObj runtime.Object) AdmissionResponse {
53-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
53+
return func(ctx context.Context, _ admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
5454
newDs, oldDs := object.(*kamajiv1alpha1.DataStore), oldObj.(*kamajiv1alpha1.DataStore) //nolint:forcetypeassert
5555

5656
if oldDs.Spec.Driver != newDs.Spec.Driver {

internal/webhook/handlers/handler.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
type AdmissionResponse func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error)
1515

1616
type Handler interface {
17-
OnCreate(runtime.Object) AdmissionResponse
18-
OnDelete(runtime.Object) AdmissionResponse
17+
OnCreate(obj runtime.Object) AdmissionResponse
18+
OnDelete(obj runtime.Object) AdmissionResponse
1919
OnUpdate(newObject runtime.Object, prevObject runtime.Object) AdmissionResponse
2020
}

internal/webhook/handlers/tcp_datastore.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type TenantControlPlaneDataStore struct {
2323
}
2424

2525
func (t TenantControlPlaneDataStore) OnCreate(object runtime.Object) AdmissionResponse {
26-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
26+
return func(ctx context.Context, _ admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
2727
tcp := object.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert
2828

2929
if tcp.Spec.DataStore != "" {
@@ -39,7 +39,7 @@ func (t TenantControlPlaneDataStore) OnDelete(runtime.Object) AdmissionResponse
3939
}
4040

4141
func (t TenantControlPlaneDataStore) OnUpdate(object runtime.Object, _ runtime.Object) AdmissionResponse {
42-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
42+
return func(ctx context.Context, _ admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
4343
tcp := object.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert
4444

4545
if tcp.Spec.DataStore != "" {

internal/webhook/handlers/tcp_defaults.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type TenantControlPlaneDefaults struct {
2424
}
2525

2626
func (t TenantControlPlaneDefaults) OnCreate(object runtime.Object) AdmissionResponse {
27-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
27+
return func(context.Context, admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
2828
original := object.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert
2929

3030
defaulted := original.DeepCopy()

internal/webhook/handlers/tcp_defaults_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var _ = Describe("TCP Defaulting Webhook", func() {
3535
},
3636
Spec: kamajiv1alpha1.TenantControlPlaneSpec{},
3737
}
38-
ctx = context.Background()
38+
ctx = context.Background() //nolint:fatcontext
3939
})
4040

4141
Describe("fields missing", func() {

internal/webhook/handlers/tcp_deployment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (t TenantControlPlaneDeployment) shouldTriggerCheck(newTCP, oldTCP kamajiv1
5454
}
5555

5656
func (t TenantControlPlaneDeployment) OnUpdate(newObject runtime.Object, oldObject runtime.Object) AdmissionResponse {
57-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
57+
return func(ctx context.Context, _ admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
5858
tcp, previousTCP := newObject.(*kamajiv1alpha1.TenantControlPlane), oldObject.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert
5959

6060
if !t.shouldTriggerCheck(*tcp, *previousTCP) {

internal/webhook/handlers/tcp_kubeletaddresses.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
type TenantControlPlaneKubeletAddresses struct{}
2020

2121
func (t TenantControlPlaneKubeletAddresses) OnCreate(object runtime.Object) AdmissionResponse {
22-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
22+
return func(context.Context, admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
2323
tcp := object.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert
2424

2525
return nil, t.validatePreferredKubeletAddressTypes(tcp.Spec.Kubernetes.Kubelet.PreferredAddressTypes)
@@ -31,7 +31,7 @@ func (t TenantControlPlaneKubeletAddresses) OnDelete(runtime.Object) AdmissionRe
3131
}
3232

3333
func (t TenantControlPlaneKubeletAddresses) OnUpdate(object runtime.Object, _ runtime.Object) AdmissionResponse {
34-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
34+
return func(context.Context, admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
3535
tcp := object.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert
3636

3737
return nil, t.validatePreferredKubeletAddressTypes(tcp.Spec.Kubernetes.Kubelet.PreferredAddressTypes)

internal/webhook/handlers/tcp_lb_src_ranges.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (t TenantControlPlaneLoadBalancerSourceRanges) OnDelete(runtime.Object) Adm
4646
}
4747

4848
func (t TenantControlPlaneLoadBalancerSourceRanges) OnUpdate(object runtime.Object, _ runtime.Object) AdmissionResponse {
49-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
49+
return func(context.Context, admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
5050
tcp := object.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert
5151

5252
if err := t.handle(tcp); err != nil {

internal/webhook/handlers/tcp_lb_src_ranges_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var _ = Describe("TCP LoadBalancer Source Ranges Webhook", func() {
3131
},
3232
Spec: kamajiv1alpha1.TenantControlPlaneSpec{},
3333
}
34-
ctx = context.Background()
34+
ctx = context.Background() //nolint:fatcontext
3535
})
3636

3737
It("allows creation when valid CIDR ranges are provided", func() {

internal/webhook/handlers/tcp_name.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
type TenantControlPlaneName struct{}
2121

2222
func (t TenantControlPlaneName) OnCreate(object runtime.Object) AdmissionResponse {
23-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
23+
return func(context.Context, admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
2424
tcp := object.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert
2525

2626
if errs := validation.IsDNS1035Label(tcp.Name); len(errs) > 0 {

internal/webhook/handlers/tcp_service_cidr.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (t TenantControlPlaneServiceCIDR) OnDelete(runtime.Object) AdmissionRespons
5959
}
6060

6161
func (t TenantControlPlaneServiceCIDR) OnUpdate(object runtime.Object, _ runtime.Object) AdmissionResponse {
62-
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
62+
return func(context.Context, admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
6363
tcp := object.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert
6464

6565
if err := t.handle(tcp); err != nil {

0 commit comments

Comments
 (0)