Skip to content

Commit 80e5f28

Browse files
committed
feat: tidy preflight internal types (#678)
1 parent 17533ff commit 80e5f28

51 files changed

Lines changed: 598 additions & 3574 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,16 @@ install-docker-buildx: ## Create `docker buildx` builder.
256256
echo "Buildx builder $(BUILDX_BUILDER) already exists"; \
257257
fi
258258

259+
GOLANGCILINT_VERSION ?= v2.8.0
260+
GOLANGCILINT_EXPECTED_VERSION = $(patsubst v%,%,$(GOLANGCILINT_VERSION))
261+
GOLANGCILINT_GOBIN_VERSION = $(shell [ -x "$(GOBIN)/golangci-lint" ] && $(GOBIN)/golangci-lint version 2>/dev/null | sed -n 's/.*version \([0-9.]*\).*/\1/p' | head -1)
262+
259263
.PHONY: golangci
260-
golangci: GOLANGCILINT_VERSION = v2.8.0
261264
golangci: ## Download golangci-lint locally if necessary.
262-
ifeq ($(shell golangci-lint version >/dev/null 2>&1 && echo ok),ok)
263-
@echo golangci-lint is already installed
264-
GOLANGCILINT=$(shell which golangci-lint)
265-
else ifeq (, $(shell which $(GOBIN)/golangci-lint))
265+
ifeq ($(GOLANGCILINT_EXPECTED_VERSION),$(GOLANGCILINT_GOBIN_VERSION))
266+
@echo golangci-lint $(GOLANGCILINT_VERSION) is already installed
267+
GOLANGCILINT=$(GOBIN)/golangci-lint
268+
else
266269
@{ \
267270
set -e ;\
268271
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\
@@ -273,9 +276,6 @@ else ifeq (, $(shell which $(GOBIN)/golangci-lint))
273276
echo 'Successfully installed' ;\
274277
}
275278
GOLANGCILINT=$(GOBIN)/golangci-lint
276-
else
277-
@echo golangci-lint is already installed
278-
GOLANGCILINT=$(GOBIN)/golangci-lint
279279
endif
280280

281281
.PHONY: staticchecktool

go.mod

Lines changed: 126 additions & 110 deletions
Large diffs are not rendered by default.

go.sum

Lines changed: 301 additions & 368 deletions
Large diffs are not rendered by default.

pkg/cmd/kubeblocks/data/ack_hostpreflight.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

pkg/cmd/kubeblocks/data/ack_preflight.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

pkg/cmd/kubeblocks/data/eks_hostpreflight.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

pkg/cmd/kubeblocks/data/eks_preflight.yaml

Lines changed: 0 additions & 65 deletions
This file was deleted.

pkg/cmd/kubeblocks/data/gke_hostpreflight.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

pkg/cmd/kubeblocks/data/gke_preflight.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

pkg/cmd/kubeblocks/data/kubeblocks_base_preflight.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,3 @@ spec:
4646
message: The volumesnapshotcontents CRD was not found in the cluster.
4747
- pass:
4848
message: volumesnapshotcontents is installed.
49-
extendAnalyzers:
50-
- clusterAccess:
51-
checkName: Check-K8S-Access
52-
outcomes:
53-
- fail:
54-
message: K8s cluster access fail
55-
- pass:
56-
message: K8s cluster access ok
57-
- taint:
58-
checkName: Required-Taint-Match
59-
outcomes:
60-
- fail:
61-
message: All nodes had taints that the pod didn't tolerate
62-
- pass:
63-
message: The taint matching succeeded
64-
- storageClass:
65-
checkName: Required-Default-SC
66-
outcomes:
67-
- warn:
68-
message: The default storage class was not found. You can use option --set storageClass=<storageClassName> when creating cluster
69-
- pass:
70-
message: Default storage class is the presence, and all good on storage classes

0 commit comments

Comments
 (0)