Skip to content

Commit f721ff4

Browse files
shanshanyingclaude
andauthored
chore: bump golangci version go version and fix spinnermsg printf (#671) (#673)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: shanshanying <shanshanying@users.noreply.github.com>
1 parent 0687263 commit f721ff4

17 files changed

Lines changed: 87 additions & 128 deletions

.github/workflows/cicd-pull-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
env:
88
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
99
BASE_BRANCH: origin/main
10-
GO_VERSION: "1.24"
10+
GO_VERSION: "1.25"
1111

1212
jobs:
1313
trigger-mode:
@@ -62,7 +62,7 @@ jobs:
6262

6363
- name: Install golangci-lint
6464
run: |
65-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
65+
curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.0
6666
6767
- name: make module
6868
run: |

.github/workflows/cicd-push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
env:
1212
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
1313
BASE_BRANCH: origin/main
14-
GO_VERSION: "1.24"
14+
GO_VERSION: "1.25"
1515

1616
jobs:
1717
trigger-mode:
@@ -139,7 +139,7 @@ jobs:
139139

140140
- name: Install golangci-lint
141141
run: |
142-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
142+
curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.0
143143
144144
- name: make module
145145
run: |

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
BASE_BRANCH: origin/main
11-
GO_VERSION: "1.24"
11+
GO_VERSION: "1.25"
1212

1313
jobs:
1414
trigger-mode:

.github/workflows/release-kbcli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
GH_TOKEN: ${{ github.token }}
1010
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
1111
TAG_NAME: ${{ github.ref_name }}
12-
GO_VERSION: "1.24"
12+
GO_VERSION: "1.25"
1313
CLI_NAME: 'kbcli'
1414
JIHULAB_KBCLI_PROJECT_ID: 85948
1515
JIHULAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}

.golangci.yaml

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,39 @@
1-
# options for analysis running
1+
version: "2"
22
run:
3-
# default concurrency is a available CPU number
43
concurrency: 4
5-
6-
# timeout for analysis, e.g. 30s, 5m, default is 1m
7-
deadline: 15m
8-
9-
timeout: 30m
10-
11-
skip-files:
12-
- "^zz_generated.*"
13-
144
build-tags:
155
- containers_image_openpgp
16-
17-
output:
18-
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
19-
format: colored-line-number
20-
21-
# print lines of code with issue, default is true
22-
print-issued-lines: true
23-
24-
# print linter name in the end of issue text, default is true
25-
print-linter-name: true
26-
27-
# check available linters @ https://golangci-lint.run/usage/linters/
286
linters:
29-
disable-all: true
30-
enable: # please keep this alphabetized
31-
# Don't use soon to deprecated[1] linters that lead to false
32-
# https://github.com/golangci/golangci-lint/issues/1841
33-
# - deadcode
34-
# - gocyclo
35-
# - loggercheck # requires golangci-lint@v1.49.0
36-
# - structcheck
37-
# - varcheck
7+
default: none
8+
enable:
389
- errcheck
3910
- gocritic
40-
# - goconst
41-
- goimports
42-
- gofmt # We enable this as well as goimports for its simplify mode.
4311
- govet
4412
- ineffassign
45-
- typecheck
4613
- misspell
4714
- nakedret
4815
- unconvert
49-
50-
linters-settings:
51-
errcheck:
52-
check-blank: false # to keep `_ = viper.BindPFlag(...)` from throwing errors
16+
settings:
17+
errcheck:
18+
check-blank: false
19+
exclusions:
20+
generated: lax
21+
presets:
22+
- comments
23+
- common-false-positives
24+
- legacy
25+
- std-error-handling
26+
paths:
27+
- third_party$
28+
- builtin$
29+
- examples$
30+
formatters:
31+
enable:
32+
- gofmt
33+
- goimports
34+
exclusions:
35+
generated: lax
36+
paths:
37+
- third_party$
38+
- builtin$
39+
- examples$

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ mod-download: ## Run go mod download against go modules.
131131

132132
.PHONY: module
133133
module: ## Run go mod tidy->verify against go modules.
134-
$(GO) mod tidy -compat=1.24
134+
$(GO) mod tidy -compat=1.25
135135
$(GO) mod verify
136136

137137
TEST_PACKAGES ?= ./pkg/... ./cmd/...
@@ -257,16 +257,19 @@ install-docker-buildx: ## Create `docker buildx` builder.
257257
fi
258258

259259
.PHONY: golangci
260-
golangci: GOLANGCILINT_VERSION = v1.64.8
260+
golangci: GOLANGCILINT_VERSION = v2.8.0
261261
golangci: ## Download golangci-lint locally if necessary.
262-
ifneq ($(shell which golangci-lint),)
262+
ifeq ($(shell golangci-lint version >/dev/null 2>&1 && echo ok),ok)
263263
@echo golangci-lint is already installed
264264
GOLANGCILINT=$(shell which golangci-lint)
265265
else ifeq (, $(shell which $(GOBIN)/golangci-lint))
266266
@{ \
267267
set -e ;\
268268
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\
269-
curl -sSfL $(GITHUB_PROXY)https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $(GOLANGCILINT_VERSION) ;\
269+
tmpfile=$$(mktemp) ;\
270+
trap 'rm -f "$$tmpfile"' EXIT ;\
271+
curl -sSfL https://golangci-lint.run/install.sh -o "$$tmpfile" ;\
272+
sh "$$tmpfile" -b $(GOBIN) $(GOLANGCILINT_VERSION) ;\
270273
echo 'Successfully installed' ;\
271274
}
272275
GOLANGCILINT=$(GOBIN)/golangci-lint

docs/user_docs/cli/kbcli_cluster_create.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,14 @@ kbcli cluster create [ClusterType] [flags]
5555

5656
* [kbcli cluster](kbcli_cluster.md) - Cluster command.
5757
* [kbcli cluster create apecloud-mysql](kbcli_cluster_create_apecloud-mysql.md) - Create a apecloud-mysql cluster.
58-
* [kbcli cluster create clickhouse](kbcli_cluster_create_clickhouse.md) - Create a clickhouse cluster.
5958
* [kbcli cluster create etcd](kbcli_cluster_create_etcd.md) - Create a etcd cluster.
60-
* [kbcli cluster create greptime](kbcli_cluster_create_greptime.md) - Create a greptime cluster.
6159
* [kbcli cluster create kafka](kbcli_cluster_create_kafka.md) - Create a kafka cluster.
62-
* [kbcli cluster create loki](kbcli_cluster_create_loki.md) - Create a loki cluster.
63-
* [kbcli cluster create milvus](kbcli_cluster_create_milvus.md) - Create a milvus cluster.
64-
* [kbcli cluster create minio](kbcli_cluster_create_minio.md) - Create a minio cluster.
6560
* [kbcli cluster create mongodb](kbcli_cluster_create_mongodb.md) - Create a mongodb cluster.
6661
* [kbcli cluster create mysql](kbcli_cluster_create_mysql.md) - Create a mysql cluster.
67-
* [kbcli cluster create oceanbase](kbcli_cluster_create_oceanbase.md) - Create a oceanbase cluster.
68-
* [kbcli cluster create orchestrator](kbcli_cluster_create_orchestrator.md) - Create a orchestrator cluster.
69-
* [kbcli cluster create polardbx](kbcli_cluster_create_polardbx.md) - Create a polardbx cluster.
7062
* [kbcli cluster create postgresql](kbcli_cluster_create_postgresql.md) - Create a postgresql cluster.
71-
* [kbcli cluster create pulsar](kbcli_cluster_create_pulsar.md) - Create a pulsar cluster.
7263
* [kbcli cluster create qdrant](kbcli_cluster_create_qdrant.md) - Create a qdrant cluster.
7364
* [kbcli cluster create rabbitmq](kbcli_cluster_create_rabbitmq.md) - Create a rabbitmq cluster.
7465
* [kbcli cluster create redis](kbcli_cluster_create_redis.md) - Create a redis cluster.
75-
* [kbcli cluster create victoria-metrics](kbcli_cluster_create_victoria-metrics.md) - Create a victoria-metrics cluster.
7666

7767
#### Go Back to [CLI Overview](cli.md) Homepage.
7868

docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,37 @@ kbcli cluster create apecloud-mysql NAME [flags]
2121
### Options
2222

2323
```
24-
--availability-policy string The availability policy of cluster. Legal values [none, node, zone]. (default "node")
25-
--cpu float CPU cores. Value range [0.5, 64]. (default 0.5)
26-
--disable-exporter Enable or disable monitor. (default true)
27-
--dry-run string[="unchanged"] Must be "client", or "server". If with client strategy, only print the object that would be sent, and no data is actually sent. If with server strategy, submit the server-side request, but no data is persistent. (default "none")
28-
--edit Edit the API resource before creating
29-
-h, --help help for apecloud-mysql
30-
--host-network-accessible Specify whether the cluster can be accessed from within the VPC.
31-
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5)
32-
--mode string Cluster topology mode. Legal values [standalone, raftGroup]. (default "standalone")
33-
--node-labels stringToString Node label selector (default [])
34-
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
35-
--pod-anti-affinity string Pod anti-affinity type, one of: (Preferred, Required) (default "Preferred")
36-
--proxy-enabled Enable proxy or not.
37-
--publicly-accessible Specify whether the cluster can be accessed from the public internet.
38-
--rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources.
39-
--replicas int The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. Value range [1, 5]. (default 1)
40-
--storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20)
41-
--storage-class-name string Storage class name of the data volume
42-
--tenancy string The tenancy of cluster. Legal values [SharedNode, DedicatedNode]. (default "SharedNode")
43-
--termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Halt, Delete, WipeOut]. (default "Delete")
44-
--tolerations strings Tolerations for cluster, such as "key=value:effect,key:effect", for example '"engineType=mongo:NoSchedule", "diskType:NoSchedule"'
45-
--topology-keys stringArray Topology keys for affinity
46-
--version string Cluster version. (default "ac-mysql-8.0.30")
24+
--cpu float CPU cores. Value range [0.5, 64]. (default 0.5)
25+
--disable-exporter Enable or disable monitor. (default true)
26+
--dry-run string[="unchanged"] Must be "client", or "server". If with client strategy, only print the object that would be sent, and no data is actually sent. If with server strategy, submit the server-side request, but no data is persistent. (default "none")
27+
--edit Edit the API resource before creating
28+
--etcd.local.etcdctl-api string (default "3")
29+
--etcd.local.replicas int Value range [1, 3]. (default 3)
30+
--etcd.local.resources.storage string (default "20Gi")
31+
--etcd.local.service-version string (default "3.5.6")
32+
--etcd.mode string Legal values [serviceRef, local]. (default "local")
33+
--etcd.service-ref.cluster.component string (default "etcd")
34+
--etcd.service-ref.cluster.credential string
35+
--etcd.service-ref.cluster.name string
36+
--etcd.service-ref.cluster.port string (default "client")
37+
--etcd.service-ref.cluster.service string (default "headless")
38+
--etcd.service-ref.namespace string (default "default")
39+
--etcd.service-ref.service-descriptor string
40+
-h, --help help for apecloud-mysql
41+
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5)
42+
--mode string Cluster topology mode. Legal values [standalone, raftGroup]. (default "standalone")
43+
--node-labels stringToString Node label selector (default [])
44+
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
45+
--pod-anti-affinity string Pod anti-affinity type, one of: (Preferred, Required) (default "Preferred")
46+
--proxy-enabled Enable proxy or not.
47+
--replicas int The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. Value range [1, 5]. (default 1)
48+
--storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20)
49+
--storage-class-name string Storage class name of the data volume
50+
--tenancy string Tenancy options, one of: (SharedNode, DedicatedNode) (default "SharedNode")
51+
--termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Delete, WipeOut]. (default "Delete")
52+
--tolerations strings Tolerations for cluster, such as "key=value:effect,key:effect", for example '"engineType=mongo:NoSchedule", "diskType:NoSchedule"'
53+
--topology-keys stringArray Topology keys for affinity
54+
--version string MySQL Service Version. (default "8.0.30")
4755
```
4856

4957
### Options inherited from parent commands

docs/user_docs/cli/kbcli_cluster_custom-ops.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -57,35 +57,6 @@ kbcli cluster custom-ops OpsDef --cluster <clusterName> <your custom params> [fl
5757
### SEE ALSO
5858

5959
* [kbcli cluster](kbcli_cluster.md) - Cluster command.
60-
* [kbcli cluster custom-ops add-arch-for-dm](kbcli_cluster_custom-ops_add-arch-for-dm.md) - Create a custom ops with opsDef add-arch-for-dm
61-
* [kbcli cluster custom-ops hdfs-balancer](kbcli_cluster_custom-ops_hdfs-balancer.md) - Create a custom ops with opsDef hdfs-balancer
62-
* [kbcli cluster custom-ops hive-server2-apply-account](kbcli_cluster_custom-ops_hive-server2-apply-account.md) - Create a custom ops with opsDef hive-server2-apply-account
63-
* [kbcli cluster custom-ops kafka-quota](kbcli_cluster_custom-ops_kafka-quota.md) - Create a custom ops with opsDef kafka-quota
64-
* [kbcli cluster custom-ops kafka-topic](kbcli_cluster_custom-ops_kafka-topic.md) - Create a custom ops with opsDef kafka-topic
65-
* [kbcli cluster custom-ops kafka-user-acl](kbcli_cluster_custom-ops_kafka-user-acl.md) - Create a custom ops with opsDef kafka-user-acl
66-
* [kbcli cluster custom-ops mongodb-shard-toggle-balancer](kbcli_cluster_custom-ops_mongodb-shard-toggle-balancer.md) - Create a custom ops with opsDef mongodb-shard-toggle-balancer
67-
* [kbcli cluster custom-ops mssql-dynamic-modify-member](kbcli_cluster_custom-ops_mssql-dynamic-modify-member.md) - Create a custom ops with opsDef mssql-dynamic-modify-member
68-
* [kbcli cluster custom-ops mssql-dynamic-modify-member-1.0.0](kbcli_cluster_custom-ops_mssql-dynamic-modify-member-1.0.0.md) - Create a custom ops with opsDef mssql-dynamic-modify-member-1.0.0
69-
* [kbcli cluster custom-ops mssql-dynamic-remove-ag](kbcli_cluster_custom-ops_mssql-dynamic-remove-ag.md) - Create a custom ops with opsDef mssql-dynamic-remove-ag
70-
* [kbcli cluster custom-ops mssql-dynamic-remove-ag-1.0.0](kbcli_cluster_custom-ops_mssql-dynamic-remove-ag-1.0.0.md) - Create a custom ops with opsDef mssql-dynamic-remove-ag-1.0.0
71-
* [kbcli cluster custom-ops mssql-dynamic-remove-member](kbcli_cluster_custom-ops_mssql-dynamic-remove-member.md) - Create a custom ops with opsDef mssql-dynamic-remove-member
72-
* [kbcli cluster custom-ops mssql-dynamic-remove-member-1.0.0](kbcli_cluster_custom-ops_mssql-dynamic-remove-member-1.0.0.md) - Create a custom ops with opsDef mssql-dynamic-remove-member-1.0.0
73-
* [kbcli cluster custom-ops nebula-balance-data](kbcli_cluster_custom-ops_nebula-balance-data.md) - Create a custom ops with opsDef nebula-balance-data
74-
* [kbcli cluster custom-ops ob-alter-unit](kbcli_cluster_custom-ops_ob-alter-unit.md) - Create a custom ops with opsDef ob-alter-unit
75-
* [kbcli cluster custom-ops ob-switch-configserver](kbcli_cluster_custom-ops_ob-switch-configserver.md) - Create a custom ops with opsDef ob-switch-configserver
76-
* [kbcli cluster custom-ops pg-update-standby-config](kbcli_cluster_custom-ops_pg-update-standby-config.md) - Create a custom ops with opsDef pg-update-standby-config
77-
* [kbcli cluster custom-ops post-rebuild-for-clickhouse](kbcli_cluster_custom-ops_post-rebuild-for-clickhouse.md) - Create a custom ops with opsDef post-rebuild-for-clickhouse
78-
* [kbcli cluster custom-ops post-scale-for-dmdb](kbcli_cluster_custom-ops_post-scale-for-dmdb.md) - Create a custom ops with opsDef post-scale-for-dmdb
79-
* [kbcli cluster custom-ops post-scale-out-shard-for-clickhouse](kbcli_cluster_custom-ops_post-scale-out-shard-for-clickhouse.md) - Create a custom ops with opsDef post-scale-out-shard-for-clickhouse
80-
* [kbcli cluster custom-ops redis-cluster-rebalance](kbcli_cluster_custom-ops_redis-cluster-rebalance.md) - Create a custom ops with opsDef redis-cluster-rebalance
81-
* [kbcli cluster custom-ops redis-master-account-ops](kbcli_cluster_custom-ops_redis-master-account-ops.md) - Create a custom ops with opsDef redis-master-account-ops
82-
* [kbcli cluster custom-ops redis-reset-master](kbcli_cluster_custom-ops_redis-reset-master.md) - Create a custom ops with opsDef redis-reset-master
83-
* [kbcli cluster custom-ops redis-sentinel-account-ops](kbcli_cluster_custom-ops_redis-sentinel-account-ops.md) - Create a custom ops with opsDef redis-sentinel-account-ops
84-
* [kbcli cluster custom-ops redis-shard-account-ops](kbcli_cluster_custom-ops_redis-shard-account-ops.md) - Create a custom ops with opsDef redis-shard-account-ops
85-
* [kbcli cluster custom-ops remove-remote-arch](kbcli_cluster_custom-ops_remove-remote-arch.md) - Create a custom ops with opsDef remove-remote-arch
86-
* [kbcli cluster custom-ops switchover-for-dm](kbcli_cluster_custom-ops_switchover-for-dm.md) - Create a custom ops with opsDef switchover-for-dm
87-
* [kbcli cluster custom-ops update-license-for-dm](kbcli_cluster_custom-ops_update-license-for-dm.md) - Create a custom ops with opsDef update-license-for-dm
88-
* [kbcli cluster custom-ops update-license-for-kingbase](kbcli_cluster_custom-ops_update-license-for-kingbase.md) - Create a custom ops with opsDef update-license-for-kingbase
8960

9061
#### Go Back to [CLI Overview](cli.md) Homepage.
9162

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/apecloud/kbcli
22

3-
go 1.24.0
3+
go 1.25.0
44

5-
toolchain go1.24.9
5+
toolchain go1.25.10
66

77
require (
88
cuelang.org/go v0.8.0

0 commit comments

Comments
 (0)