Skip to content

Commit

Permalink
chore(golangci-lint): bumping up to v1.62.2
Browse files Browse the repository at this point in the history
Signed-off-by: Dario Tranchitella <[email protected]>
  • Loading branch information
prometherion committed Dec 1, 2024
1 parent 6097f9e commit f47f6ad
Show file tree
Hide file tree
Showing 30 changed files with 58 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/[email protected]
with:
version: v1.54.2
version: v1.62.2
only-new-issues: false
args: --timeout 5m --config .golangci.yml
diff:
Expand Down
23 changes: 11 additions & 12 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
linters-settings:
revive:
rules:
- name: dot-imports
arguments:
- allowedPackages:
- "github.com/onsi/ginkgo/v2"
- "github.com/onsi/gomega"
gci:
sections:
- standard
Expand All @@ -13,16 +20,14 @@ linters:
disable:
- depguard
- wrapcheck
- gomnd
- scopelint
- mnd
- varnamelen
- testpackage
- tagliatelle
- paralleltest
- ireturn
- goerr113
- err113
- gochecknoglobals
- exhaustivestruct
- wsl
- exhaustive
- nosprintfhostport
Expand All @@ -39,13 +44,7 @@ linters:
- cyclop
- gocognit
- nestif
- perfsprint
# deprecated linters
- deadcode
- golint
- interfacer
- structcheck
- varcheck
- nosnakecase
- ifshort
- maligned
- exportloopref
enable-all: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2

.PHONY: apidocs-gen
apidocs-gen: $(APIDOCS_GEN) ## Download crdoc locally if necessary.
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/suite_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2022 Clastix Labs
// SPDX-License-Identifier: Apache-2.0

package v1alpha1

import (
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/tenantcontrolplane_interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ package v1alpha1
// +kubebuilder:object:generate=false
type KubeadmConfigChecksumDependant interface {
GetChecksum() string
SetChecksum(string)
SetChecksum(checksum string)
}
2 changes: 1 addition & 1 deletion api/v1alpha1/tenantcontrolplane_kubeadmphase_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func (in KubeadmPhaseStatus) GetChecksum() string {
func (in *KubeadmPhaseStatus) GetChecksum() string {
return in.Checksum
}

Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/tenantcontrolplane_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var _ = Describe("Cluster controller", func() {
)

BeforeEach(func() {
ctx = context.Background()
ctx = context.Background() //nolint:fatcontext
tcp = &TenantControlPlane{
ObjectMeta: metav1.ObjectMeta{
Name: "tcp",
Expand Down
4 changes: 2 additions & 2 deletions cmd/manager/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command {
Short: "Start the Kamaji Kubernetes Operator",
SilenceErrors: false,
SilenceUsage: true,
PreRunE: func(cmd *cobra.Command, args []string) (err error) {
PreRunE: func(cmd *cobra.Command, _ []string) (err error) {
// Avoid to pollute Kamaji stdout with useless details by the underlying klog implementations
klog.SetOutput(io.Discard)
klog.LogToStderr(false)
Expand All @@ -95,7 +95,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command {

return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(*cobra.Command, []string) error {
setupLog := ctrl.Log.WithName("setup")

setupLog.Info(fmt.Sprintf("Kamaji version %s %s%s", internal.GitTag, internal.GitCommit, internal.GitDirty))
Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command {
Use: "migrate",
Short: "Migrate the data of a TenantControlPlane to another compatible DataStore",
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(*cobra.Command, []string) error {
ctx, cancelFn := context.WithTimeout(context.Background(), timeout)
defer cancelFn()

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command {
return &cobra.Command{
Use: "kamaji",
Short: "Build and operate Kubernetes at scale with a fraction of operational burden.",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(*cobra.Command, []string) {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(kamajiv1alpha1.AddToScheme(scheme))
utilruntime.Must(appsv1.RegisterDefaults(scheme))
Expand Down
2 changes: 1 addition & 1 deletion controllers/datastore_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (r *DataStore) SetupWithManager(mgr controllerruntime.Manager) error {
CreateFunc: func(_ context.Context, createEvent event.TypedCreateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request]) {
enqueueFn(createEvent.Object.(*kamajiv1alpha1.TenantControlPlane), w)
},
UpdateFunc: func(ctx context.Context, updateEvent event.TypedUpdateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request]) {
UpdateFunc: func(_ context.Context, updateEvent event.TypedUpdateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request]) {
enqueueFn(updateEvent.ObjectOld.(*kamajiv1alpha1.TenantControlPlane), w)
enqueueFn(updateEvent.ObjectNew.(*kamajiv1alpha1.TenantControlPlane), w)
},
Expand Down
2 changes: 1 addition & 1 deletion controllers/soot/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (m *Manager) Reconcile(ctx context.Context, request reconcile.Request) (res
Metrics: metricsserver.Options{
BindAddress: "0",
},
NewClient: func(config *rest.Config, options client.Options) (client.Client, error) {
NewClient: func(config *rest.Config, _ client.Options) (client.Client, error) {
return client.New(config, client.Options{
Scheme: m.client.Scheme(),
})
Expand Down
1 change: 1 addition & 0 deletions e2e/tcp_additional_resources_ready_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2022 Clastix Labs
// SPDX-License-Identifier: Apache-2.0

//nolint:ginkgolinter
package e2e

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var _ = Describe("DatastoreStorageConfig", func() {
)

BeforeEach(func() {
ctx = context.Background()
ctx = context.Background() //nolint:fatcontext

tcp = &kamajiv1alpha1.TenantControlPlane{
ObjectMeta: metav1.ObjectMeta{
Expand Down
4 changes: 2 additions & 2 deletions internal/resources/konnectivity/service_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (r *ServiceResource) ShouldStatusBeUpdated(_ context.Context, tenantControl
return true
}

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

resourcePorts := resourceIngresses[i].Ports
statusPorts := statusIngresses[i].Ports
for j := 0; j < len(resourcePorts); j++ {
for j := range resourcePorts {
if resourcePorts[j].Port != statusPorts[j].Port ||
resourcePorts[j].Protocol != statusPorts[j].Protocol {
return true
Expand Down
2 changes: 1 addition & 1 deletion internal/resources/kubeadm_phases.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (r *KubeadmPhase) UpdateTenantControlPlaneStatus(ctx context.Context, tenan
func (r *KubeadmPhase) GetStatus(tenantControlPlane *kamajiv1alpha1.TenantControlPlane) (kamajiv1alpha1.KubeadmConfigChecksumDependant, error) {
switch r.Phase {
case PhaseUploadConfigKubeadm, PhaseUploadConfigKubelet, PhaseClusterAdminRBAC:
return nil, nil
return nil, nil //nolint:nilnil
case PhaseBootstrapToken:
return &tenantControlPlane.Status.KubeadmPhase.BootstrapToken, nil
default:
Expand Down
22 changes: 11 additions & 11 deletions internal/resources/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ const (
)

type Resource interface {
Define(context.Context, *kamajiv1alpha1.TenantControlPlane) error
ShouldCleanup(*kamajiv1alpha1.TenantControlPlane) bool
CleanUp(context.Context, *kamajiv1alpha1.TenantControlPlane) (bool, error)
CreateOrUpdate(context.Context, *kamajiv1alpha1.TenantControlPlane) (controllerutil.OperationResult, error)
Define(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) error
ShouldCleanup(tcp *kamajiv1alpha1.TenantControlPlane) bool
CleanUp(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) (bool, error)
CreateOrUpdate(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) (controllerutil.OperationResult, error)
GetName() string
ShouldStatusBeUpdated(context.Context, *kamajiv1alpha1.TenantControlPlane) bool
UpdateTenantControlPlaneStatus(context.Context, *kamajiv1alpha1.TenantControlPlane) error
ShouldStatusBeUpdated(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) bool
UpdateTenantControlPlaneStatus(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) error
}

type DeletableResource interface {
GetName() string
Define(context.Context, *kamajiv1alpha1.TenantControlPlane) error
Delete(context.Context, *kamajiv1alpha1.TenantControlPlane) error
Define(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) error
Delete(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) error
}

type KubeadmResource interface {
Expand All @@ -45,9 +45,9 @@ type KubeadmPhaseResource interface {
Resource
KubeadmResource
GetClient() client.Client
GetKubeadmFunction(context.Context, *kamajiv1alpha1.TenantControlPlane) (func(clientset.Interface, *kubeadm.Configuration) ([]byte, error), error)
GetStatus(*kamajiv1alpha1.TenantControlPlane) (kamajiv1alpha1.KubeadmConfigChecksumDependant, error)
SetKubeadmConfigChecksum(string)
GetKubeadmFunction(ctx context.Context, tcp *kamajiv1alpha1.TenantControlPlane) (func(clientset.Interface, *kubeadm.Configuration) ([]byte, error), error)
GetStatus(tcp *kamajiv1alpha1.TenantControlPlane) (kamajiv1alpha1.KubeadmConfigChecksumDependant, error)
SetKubeadmConfigChecksum(checksum string)
GetWatchedObject() client.Object
GetPredicateFunc() func(obj client.Object) bool
}
Expand Down
2 changes: 1 addition & 1 deletion internal/webhook/handlers/ds_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (d DataStoreSecretValidation) OnDelete(runtime.Object) AdmissionResponse {
}

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

dsList := &kamajiv1alpha1.DataStoreList{}
Expand Down
6 changes: 3 additions & 3 deletions internal/webhook/handlers/ds_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ type DataStoreValidation struct {
}

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

return nil, d.validate(ctx, *ds)
}
}

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

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

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

if oldDs.Spec.Driver != newDs.Spec.Driver {
Expand Down
4 changes: 2 additions & 2 deletions internal/webhook/handlers/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
type AdmissionResponse func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error)

type Handler interface {
OnCreate(runtime.Object) AdmissionResponse
OnDelete(runtime.Object) AdmissionResponse
OnCreate(obj runtime.Object) AdmissionResponse
OnDelete(obj runtime.Object) AdmissionResponse
OnUpdate(newObject runtime.Object, prevObject runtime.Object) AdmissionResponse
}
4 changes: 2 additions & 2 deletions internal/webhook/handlers/tcp_datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type TenantControlPlaneDataStore struct {
}

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

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

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

if tcp.Spec.DataStore != "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/webhook/handlers/tcp_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type TenantControlPlaneDefaults struct {
}

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

defaulted := original.DeepCopy()
Expand Down
2 changes: 1 addition & 1 deletion internal/webhook/handlers/tcp_defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var _ = Describe("TCP Defaulting Webhook", func() {
},
Spec: kamajiv1alpha1.TenantControlPlaneSpec{},
}
ctx = context.Background()
ctx = context.Background() //nolint:fatcontext
})

Describe("fields missing", func() {
Expand Down
2 changes: 1 addition & 1 deletion internal/webhook/handlers/tcp_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (t TenantControlPlaneDeployment) shouldTriggerCheck(newTCP, oldTCP kamajiv1
}

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

if !t.shouldTriggerCheck(*tcp, *previousTCP) {
Expand Down
4 changes: 2 additions & 2 deletions internal/webhook/handlers/tcp_kubeletaddresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
type TenantControlPlaneKubeletAddresses struct{}

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

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

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

return nil, t.validatePreferredKubeletAddressTypes(tcp.Spec.Kubernetes.Kubelet.PreferredAddressTypes)
Expand Down
2 changes: 1 addition & 1 deletion internal/webhook/handlers/tcp_lb_src_ranges.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (t TenantControlPlaneLoadBalancerSourceRanges) OnDelete(runtime.Object) Adm
}

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

if err := t.handle(tcp); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/webhook/handlers/tcp_lb_src_ranges_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var _ = Describe("TCP LoadBalancer Source Ranges Webhook", func() {
},
Spec: kamajiv1alpha1.TenantControlPlaneSpec{},
}
ctx = context.Background()
ctx = context.Background() //nolint:fatcontext
})

It("allows creation when valid CIDR ranges are provided", func() {
Expand Down
2 changes: 1 addition & 1 deletion internal/webhook/handlers/tcp_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
type TenantControlPlaneName struct{}

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

if errs := validation.IsDNS1035Label(tcp.Name); len(errs) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion internal/webhook/handlers/tcp_service_cidr.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (t TenantControlPlaneServiceCIDR) OnDelete(runtime.Object) AdmissionRespons
}

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

if err := t.handle(tcp); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/webhook/handlers/tcp_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
type TenantControlPlaneVersion struct{}

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

ver, err := semver.New(t.normalizeKubernetesVersion(tcp.Spec.Kubernetes.Version))
Expand Down Expand Up @@ -56,7 +56,7 @@ func (t TenantControlPlaneVersion) OnDelete(runtime.Object) AdmissionResponse {
}

func (t TenantControlPlaneVersion) OnUpdate(object runtime.Object, oldObject runtime.Object) AdmissionResponse {
return func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
return func(context.Context, admission.Request) ([]jsonpatch.JsonPatchOperation, error) {
newTCP, oldTCP := object.(*kamajiv1alpha1.TenantControlPlane), oldObject.(*kamajiv1alpha1.TenantControlPlane) //nolint:forcetypeassert

oldVer, oldErr := semver.Make(t.normalizeKubernetesVersion(oldTCP.Spec.Kubernetes.Version))
Expand Down

0 comments on commit f47f6ad

Please sign in to comment.