Skip to content

Commit 2f094e4

Browse files
committed
try to fix lint
1 parent 1c79f35 commit 2f094e4

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.github/workflows/golangci-lint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: golangci-lint
22

33
on:
44
pull_request:
5-
types: [opened, edited, synchronize, reopened]
5+
types: [opened, synchronize, reopened]
66

77
# Remove all permissions from GITHUB_TOKEN except metadata.
88
permissions: {}
@@ -15,10 +15,10 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-go@v4
1717
with:
18-
go-version: 1.19
18+
go-version: 1.20.5
1919
check-latest: true
2020
- name: golangci-lint
2121
uses: golangci/golangci-lint-action@v3.4.0
2222
with:
23-
version: v1.52.2
23+
version: v1.53.3
2424
args: --timeout 5m

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ fmt: ## Run go fmt against code.
5757
vet: ## Run go vet against code.
5858
go vet ./...
5959

60+
.PHONY: lint
61+
lint: ## Run golangci-lint
62+
$(GOLANGCI_LINT) run
63+
6064
CLUSTER_NAME := cappx-test
6165

6266
.PHONY: create-workload-cluster
@@ -180,6 +184,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
180184
ENVTEST ?= $(LOCALBIN)/setup-envtest
181185
ENVSUBST ?= $(LOCALBIN)/envsubst
182186
KUBECTL ?= $(LOCALBIN)/kubectl
187+
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
183188

184189
## Tool Versions
185190
KUSTOMIZE_VERSION ?= v5.0.0
@@ -222,4 +227,9 @@ $(KUBECTL): $(LOCALBIN)
222227
.PHONY: setup-envtest
223228
setup-envtest: $(SETUP_ENVTEST)
224229
$(SETUP_ENVTEST): go.mod # Build setup-envtest from tools folder.
225-
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(SETUP_ENVTEST_VER)
230+
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(SETUP_ENVTEST_VER)
231+
232+
.PHONY: golangci-lint
233+
golangci-lint: $(GOLANGCI_LINT)
234+
$(GOLANGCI_LINT): $(LOCALBIN)
235+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(LOCALBIN) v1.54.0

cloud/services/compute/instance/image.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ func (s *Service) setCloudImage(ctx context.Context) error {
4747
// workaround
4848
// API does not support something equivalent of "qm importdisk"
4949
vnc, err := s.vncClient(s.scope.NodeName())
50+
if err != nil {
51+
return errors.Errorf("failed to create vnc client: %v", err)
52+
}
5053
defer vnc.Close()
5154
out, _, err := vnc.Exec(ctx, fmt.Sprintf("wget %s --directory-prefix %s -nc", url, rawImageDirPath))
5255
if err != nil {

0 commit comments

Comments
 (0)