Skip to content

Commit

Permalink
bump golangci version
Browse files Browse the repository at this point in the history
  • Loading branch information
waynz0r committed Jan 26, 2024
1 parent 762fe4a commit 4588c9f
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 14 deletions.
12 changes: 12 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,25 @@ linters:
# - nestif
# - testpackage

- mirror
- revive
- contextcheck
- depguard
- exhaustruct
- nonamedreturns

# special cases only
- exhaustivestruct

# deprecated
- maligned
- interfacer
- scopelint
- varcheck
- structcheck
- nosnakecase
- deadcode
- ifshort

linters-settings:
gomnd:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ API_REL_TAG ?= api/${REL_TAG}
EMBEDDED_CHART_REL_TAG ?= deploy/charts/v${CHART_VERSION}
HELM_CHART_REL_TAG ?= chart/istio-operator/${CHART_VERSION}

GOLANGCI_VERSION = 1.45.2
LICENSEI_VERSION = 0.7.0
GOLANGCI_VERSION = 1.54.2
LICENSEI_VERSION = 0.9.0
ENVTEST_K8S_VERSION = 1.26.0
KUSTOMIZE_VERSION = 4.1.2
ISTIO_VERSION = 1.17.1
Expand Down
6 changes: 3 additions & 3 deletions controllers/istiocontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const (
istioControlPlaneFinalizerID = "istio-controlplane.servicemesh.cisco.com"
meshExpansionGatewayRemovalRequeueDuration = time.Second * 30
readerServiceAccountName = "istio-reader"
// nolint:gosec
//nolint:gosec
readerSecretType = "k8s.cisco.com/istio-reader-secret"
)

Expand Down Expand Up @@ -850,7 +850,7 @@ func (r *IstioControlPlaneReconciler) getMeshNetworks(ctx context.Context, icp *
Gw: &v1alpha1.Network_IstioNetworkGateway_Address{
Address: address,
},
Port: 15443, // nolint:gomnd
Port: 15443, //nolint:gomnd
})
}

Expand Down Expand Up @@ -1272,7 +1272,7 @@ func (r *IstioControlPlaneReconciler) getNamespaceInjectionSourcePICP(ctx contex
var sourceICP *servicemeshv1alpha1.PeerIstioControlPlane
for _, picp := range picpList.Items {
picp := picp
if v, ok := picp.GetAnnotations()[servicemeshv1alpha1.NamespaceInjectionSourceAnnotation]; ok && v == "true" && picp.GetStatus().IstioControlPlaneName == cp.Name { // nolint:goconst
if v, ok := picp.GetAnnotations()[servicemeshv1alpha1.NamespaceInjectionSourceAnnotation]; ok && v == "true" && picp.GetStatus().IstioControlPlaneName == cp.Name { //nolint:goconst
sourceICP = &picp
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/components/cni/cni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion internal/components/discovery/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion internal/components/meshexpansion/meshexpansion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion internal/util/openshift/predicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func removeSecretsFromServiceAccount(client client.Client, obj []byte) ([]byte,

func removeSecretsFromField(client client.Client, secretsField []interface{}, namespace string) ([]interface{}, error) {
for i, s := range secretsField {
if secret, ok := s.(map[string]interface{}); ok { // nolint:nestif
if secret, ok := s.(map[string]interface{}); ok { //nolint:nestif
value, mapHasKey := secret["name"]
secretName, ok := value.(string)
secret := &corev1.Secret{}
Expand Down
4 changes: 2 additions & 2 deletions internal/util/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func fromYamlTemplateFunc(value string) (map[string]interface{}, error) {
}

func valueIfTemplateFunc(value interface{}) (string, error) {
if dict, ok := value.(map[string]interface{}); ok { // nolint:nestif
if dict, ok := value.(map[string]interface{}); ok { //nolint:nestif
var value interface{}
var key string

Expand Down Expand Up @@ -148,7 +148,7 @@ func reformatYamlTemplateFunc(value interface{}) (string, error) {
func toYamlIfTemplateFunc(value interface{}) (string, error) {
sprig.TxtFuncMap()
body := []string{}
if dict, ok := value.(map[string]interface{}); ok { // nolint:nestif
if dict, ok := value.(map[string]interface{}); ok { //nolint:nestif
if key, ok := dict["key"]; ok {
body = append(body, fmt.Sprintf("%s:", key))
}
Expand Down

0 comments on commit 4588c9f

Please sign in to comment.