diff --git a/Makefile b/Makefile index 73239c78c3..e451e5e30b 100644 --- a/Makefile +++ b/Makefile @@ -75,14 +75,11 @@ DOCKER_BUILD ?= $(DOCKER) run --rm $(if $(ISTTY),-it) -u $(shell id -u):$(shell all: container hyperfed controller kubefedctl webhook e2e # Unit tests -test: vet +test: go test $(TEST_PKGS) build: hyperfed controller kubefedctl webhook -vet: - go vet $(TEST_PKGS) - lint: golangci-lint run -c .golangci.yml --fix diff --git a/hack/verify-errpkg.sh b/hack/verify-errpkg.sh index b6078ece90..c86a365849 100755 --- a/hack/verify-errpkg.sh +++ b/hack/verify-errpkg.sh @@ -37,7 +37,7 @@ bad_files=$(find_files | xargs $ERRORPKG) || true popd > /dev/null if [[ -n "${bad_files}" ]]; then - echo "Please Switch from fmt.errorf to github/pkg/errors to fix the following files:" + echo "Please Switch from fmt.Errorf to \`errors\` to fix the following files:" echo "${bad_files}" exit 1 fi diff --git a/pkg/controller/kubefedcluster/clusterclient.go b/pkg/controller/kubefedcluster/clusterclient.go index 2d11a25dd4..03066f716a 100644 --- a/pkg/controller/kubefedcluster/clusterclient.go +++ b/pkg/controller/kubefedcluster/clusterclient.go @@ -71,13 +71,11 @@ func NewClusterClientSet(c *fedv1b1.KubeFedCluster, client generic.Client, fedNa if err != nil { return nil, err } - clusterConfig.Timeout = timeout //nolint:staticcheck + clusterConfig.Timeout = timeout var clusterClientSet = ClusterClient{clusterName: c.Name} - if clusterConfig != nil { - clusterClientSet.kubeClient = kubeclientset.NewForConfigOrDie((restclient.AddUserAgent(clusterConfig, UserAgentName))) - if clusterClientSet.kubeClient == nil { - return nil, nil - } + clusterClientSet.kubeClient = kubeclientset.NewForConfigOrDie((restclient.AddUserAgent(clusterConfig, UserAgentName))) + if clusterClientSet.kubeClient == nil { + return nil, nil } return &clusterClientSet, nil } diff --git a/pkg/kubefedctl/federate/util.go b/pkg/kubefedctl/federate/util.go index 14044ed8a3..36a4ce0810 100644 --- a/pkg/kubefedctl/federate/util.go +++ b/pkg/kubefedctl/federate/util.go @@ -159,7 +159,7 @@ func apiResourceGroupMatchesSkipName(skipAPIResourceNames []string, group string } func apiResourceMatchesSkipName(apiResource metav1.APIResource, skipAPIResourceNames []string, group string) bool { - names := append(controllerCreatedAPIResourceNames, skipAPIResourceNames...) + names := append(controllerCreatedAPIResourceNames, skipAPIResourceNames...) //nolint:gocritic for _, name := range names { if name == "" { continue diff --git a/pkg/schedulingtypes/replicascheduler.go b/pkg/schedulingtypes/replicascheduler.go index 537fe3fdd8..05563cfb42 100644 --- a/pkg/schedulingtypes/replicascheduler.go +++ b/pkg/schedulingtypes/replicascheduler.go @@ -376,7 +376,7 @@ func clustersReplicaState( return nil, nil, status, err } - podResult := podanalyzer.PodAnalysisResult{} + var podResult podanalyzer.PodAnalysisResult podResult, status = podanalyzer.AnalyzePods(podList, time.Now()) currentReplicasPerCluster[clusterName] = int64(podResult.RunningAndReady) // include pending as well? unschedulable := int64(podResult.Unschedulable) diff --git a/scripts/download-binaries.sh b/scripts/download-binaries.sh index 0d4191711d..899a83b2b0 100755 --- a/scripts/download-binaries.sh +++ b/scripts/download-binaries.sh @@ -52,13 +52,13 @@ curl "${curl_args}" "${kb_url}" \ export KUBEBUILDER_ASSETS="${dest_dir}" echo "Setting to KUBEBUILDER_ASSETS ${dest_dir}" -helm_version="3.3.4" +helm_version="3.6.0" helm_tgz="helm-v${helm_version}-${platform}-amd64.tar.gz" helm_url="https://get.helm.sh/$helm_tgz" curl "${curl_args}" "${helm_url}" \ | tar xzP -C "${dest_dir}" --strip-components=1 "${platform}-amd64/helm" -golint_version="1.31.0" +golint_version="1.40.1" golint_dir="golangci-lint-${golint_version}-${platform}-amd64" golint_tgz="${golint_dir}.tar.gz" golint_url="https://github.com/golangci/golangci-lint/releases/download/v${golint_version}/${golint_tgz}"