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

Commit

Permalink
Merge pull request #1426 from mesosphere/golangci-lint-1.41.1
Browse files Browse the repository at this point in the history
Upgrade golangci-lint and helm
  • Loading branch information
k8s-ci-robot authored Jun 16, 2021
2 parents b162f4f + 61e252b commit 29a8171
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion hack/verify-errpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 4 additions & 6 deletions pkg/controller/kubefedcluster/clusterclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubefedctl/federate/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/schedulingtypes/replicascheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions scripts/download-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 29a8171

Please sign in to comment.