Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit 29a8171

Browse files
authored
Merge pull request #1426 from mesosphere/golangci-lint-1.41.1
Upgrade golangci-lint and helm
2 parents b162f4f + 61e252b commit 29a8171

File tree

6 files changed

+10
-15
lines changed

6 files changed

+10
-15
lines changed

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,11 @@ DOCKER_BUILD ?= $(DOCKER) run --rm $(if $(ISTTY),-it) -u $(shell id -u):$(shell
7575
all: container hyperfed controller kubefedctl webhook e2e
7676

7777
# Unit tests
78-
test: vet
78+
test:
7979
go test $(TEST_PKGS)
8080

8181
build: hyperfed controller kubefedctl webhook
8282

83-
vet:
84-
go vet $(TEST_PKGS)
85-
8683
lint:
8784
golangci-lint run -c .golangci.yml --fix
8885

hack/verify-errpkg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ bad_files=$(find_files | xargs $ERRORPKG) || true
3737
popd > /dev/null
3838

3939
if [[ -n "${bad_files}" ]]; then
40-
echo "Please Switch from fmt.errorf to github/pkg/errors to fix the following files:"
40+
echo "Please Switch from fmt.Errorf to \`errors\` to fix the following files:"
4141
echo "${bad_files}"
4242
exit 1
4343
fi

pkg/controller/kubefedcluster/clusterclient.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,11 @@ func NewClusterClientSet(c *fedv1b1.KubeFedCluster, client generic.Client, fedNa
7171
if err != nil {
7272
return nil, err
7373
}
74-
clusterConfig.Timeout = timeout //nolint:staticcheck
74+
clusterConfig.Timeout = timeout
7575
var clusterClientSet = ClusterClient{clusterName: c.Name}
76-
if clusterConfig != nil {
77-
clusterClientSet.kubeClient = kubeclientset.NewForConfigOrDie((restclient.AddUserAgent(clusterConfig, UserAgentName)))
78-
if clusterClientSet.kubeClient == nil {
79-
return nil, nil
80-
}
76+
clusterClientSet.kubeClient = kubeclientset.NewForConfigOrDie((restclient.AddUserAgent(clusterConfig, UserAgentName)))
77+
if clusterClientSet.kubeClient == nil {
78+
return nil, nil
8179
}
8280
return &clusterClientSet, nil
8381
}

pkg/kubefedctl/federate/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func apiResourceGroupMatchesSkipName(skipAPIResourceNames []string, group string
159159
}
160160

161161
func apiResourceMatchesSkipName(apiResource metav1.APIResource, skipAPIResourceNames []string, group string) bool {
162-
names := append(controllerCreatedAPIResourceNames, skipAPIResourceNames...)
162+
names := append(controllerCreatedAPIResourceNames, skipAPIResourceNames...) //nolint:gocritic
163163
for _, name := range names {
164164
if name == "" {
165165
continue

pkg/schedulingtypes/replicascheduler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ func clustersReplicaState(
376376
return nil, nil, status, err
377377
}
378378

379-
podResult := podanalyzer.PodAnalysisResult{}
379+
var podResult podanalyzer.PodAnalysisResult
380380
podResult, status = podanalyzer.AnalyzePods(podList, time.Now())
381381
currentReplicasPerCluster[clusterName] = int64(podResult.RunningAndReady) // include pending as well?
382382
unschedulable := int64(podResult.Unschedulable)

scripts/download-binaries.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ curl "${curl_args}" "${kb_url}" \
5252
export KUBEBUILDER_ASSETS="${dest_dir}"
5353
echo "Setting to KUBEBUILDER_ASSETS ${dest_dir}"
5454

55-
helm_version="3.3.4"
55+
helm_version="3.6.0"
5656
helm_tgz="helm-v${helm_version}-${platform}-amd64.tar.gz"
5757
helm_url="https://get.helm.sh/$helm_tgz"
5858
curl "${curl_args}" "${helm_url}" \
5959
| tar xzP -C "${dest_dir}" --strip-components=1 "${platform}-amd64/helm"
6060

61-
golint_version="1.31.0"
61+
golint_version="1.40.1"
6262
golint_dir="golangci-lint-${golint_version}-${platform}-amd64"
6363
golint_tgz="${golint_dir}.tar.gz"
6464
golint_url="https://github.com/golangci/golangci-lint/releases/download/v${golint_version}/${golint_tgz}"

0 commit comments

Comments
 (0)