Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cicd-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
BASE_BRANCH: origin/main
GO_VERSION: "1.24"
GO_VERSION: "1.25"

jobs:
trigger-mode:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:

- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.0

- name: make module
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cicd-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
BASE_BRANCH: origin/main
GO_VERSION: "1.24"
GO_VERSION: "1.25"

jobs:
trigger-mode:
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:

- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.0

- name: make module
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
BASE_BRANCH: origin/main
GO_VERSION: "1.24"
GO_VERSION: "1.25"

jobs:
trigger-mode:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-kbcli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
TAG_NAME: ${{ github.ref_name }}
GO_VERSION: "1.24"
GO_VERSION: "1.25"
CLI_NAME: 'kbcli'
JIHULAB_KBCLI_PROJECT_ID: 85948
JIHULAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
Expand Down
67 changes: 27 additions & 40 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,39 @@
# options for analysis running
version: "2"
run:
# default concurrency is a available CPU number
concurrency: 4

# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 15m

timeout: 30m

skip-files:
- "^zz_generated.*"

build-tags:
- containers_image_openpgp

output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true

# print linter name in the end of issue text, default is true
print-linter-name: true

# check available linters @ https://golangci-lint.run/usage/linters/
linters:
disable-all: true
enable: # please keep this alphabetized
# Don't use soon to deprecated[1] linters that lead to false
# https://github.com/golangci/golangci-lint/issues/1841
# - deadcode
# - gocyclo
# - loggercheck # requires golangci-lint@v1.49.0
# - structcheck
# - varcheck
default: none
enable:
- errcheck
- gocritic
# - goconst
- goimports
- gofmt # We enable this as well as goimports for its simplify mode.
- govet
- ineffassign
- typecheck
- misspell
- nakedret
- unconvert

linters-settings:
errcheck:
check-blank: false # to keep `_ = viper.BindPFlag(...)` from throwing errors
settings:
errcheck:
check-blank: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ mod-download: ## Run go mod download against go modules.

.PHONY: module
module: ## Run go mod tidy->verify against go modules.
$(GO) mod tidy -compat=1.24
$(GO) mod tidy -compat=1.25
$(GO) mod verify

TEST_PACKAGES ?= ./pkg/... ./cmd/...
Expand Down Expand Up @@ -257,16 +257,19 @@ install-docker-buildx: ## Create `docker buildx` builder.
fi

.PHONY: golangci
golangci: GOLANGCILINT_VERSION = v1.64.8
golangci: GOLANGCILINT_VERSION = v2.8.0
golangci: ## Download golangci-lint locally if necessary.
ifneq ($(shell which golangci-lint),)
ifeq ($(shell golangci-lint version >/dev/null 2>&1 && echo ok),ok)
@echo golangci-lint is already installed
GOLANGCILINT=$(shell which golangci-lint)
else ifeq (, $(shell which $(GOBIN)/golangci-lint))
@{ \
set -e ;\
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\
curl -sSfL $(GITHUB_PROXY)https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $(GOLANGCILINT_VERSION) ;\
tmpfile=$$(mktemp) ;\
trap 'rm -f "$$tmpfile"' EXIT ;\
curl -sSfL https://golangci-lint.run/install.sh -o "$$tmpfile" ;\
sh "$$tmpfile" -b $(GOBIN) $(GOLANGCILINT_VERSION) ;\
echo 'Successfully installed' ;\
}
GOLANGCILINT=$(GOBIN)/golangci-lint
Expand Down
10 changes: 0 additions & 10 deletions docs/user_docs/cli/kbcli_cluster_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,14 @@ kbcli cluster create [ClusterType] [flags]

* [kbcli cluster](kbcli_cluster.md) - Cluster command.
* [kbcli cluster create apecloud-mysql](kbcli_cluster_create_apecloud-mysql.md) - Create a apecloud-mysql cluster.
* [kbcli cluster create clickhouse](kbcli_cluster_create_clickhouse.md) - Create a clickhouse cluster.
* [kbcli cluster create etcd](kbcli_cluster_create_etcd.md) - Create a etcd cluster.
* [kbcli cluster create greptime](kbcli_cluster_create_greptime.md) - Create a greptime cluster.
* [kbcli cluster create kafka](kbcli_cluster_create_kafka.md) - Create a kafka cluster.
* [kbcli cluster create loki](kbcli_cluster_create_loki.md) - Create a loki cluster.
* [kbcli cluster create milvus](kbcli_cluster_create_milvus.md) - Create a milvus cluster.
* [kbcli cluster create minio](kbcli_cluster_create_minio.md) - Create a minio cluster.
* [kbcli cluster create mongodb](kbcli_cluster_create_mongodb.md) - Create a mongodb cluster.
* [kbcli cluster create mysql](kbcli_cluster_create_mysql.md) - Create a mysql cluster.
* [kbcli cluster create oceanbase](kbcli_cluster_create_oceanbase.md) - Create a oceanbase cluster.
* [kbcli cluster create orchestrator](kbcli_cluster_create_orchestrator.md) - Create a orchestrator cluster.
* [kbcli cluster create polardbx](kbcli_cluster_create_polardbx.md) - Create a polardbx cluster.
* [kbcli cluster create postgresql](kbcli_cluster_create_postgresql.md) - Create a postgresql cluster.
* [kbcli cluster create pulsar](kbcli_cluster_create_pulsar.md) - Create a pulsar cluster.
* [kbcli cluster create qdrant](kbcli_cluster_create_qdrant.md) - Create a qdrant cluster.
* [kbcli cluster create rabbitmq](kbcli_cluster_create_rabbitmq.md) - Create a rabbitmq cluster.
* [kbcli cluster create redis](kbcli_cluster_create_redis.md) - Create a redis cluster.
* [kbcli cluster create victoria-metrics](kbcli_cluster_create_victoria-metrics.md) - Create a victoria-metrics cluster.

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

54 changes: 31 additions & 23 deletions docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,37 @@ kbcli cluster create apecloud-mysql NAME [flags]
### Options

```
--availability-policy string The availability policy of cluster. Legal values [none, node, zone]. (default "node")
--cpu float CPU cores. Value range [0.5, 64]. (default 0.5)
--disable-exporter Enable or disable monitor. (default true)
--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")
--edit Edit the API resource before creating
-h, --help help for apecloud-mysql
--host-network-accessible Specify whether the cluster can be accessed from within the VPC.
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5)
--mode string Cluster topology mode. Legal values [standalone, raftGroup]. (default "standalone")
--node-labels stringToString Node label selector (default [])
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--pod-anti-affinity string Pod anti-affinity type, one of: (Preferred, Required) (default "Preferred")
--proxy-enabled Enable proxy or not.
--publicly-accessible Specify whether the cluster can be accessed from the public internet.
--rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources.
--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)
--storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20)
--storage-class-name string Storage class name of the data volume
--tenancy string The tenancy of cluster. Legal values [SharedNode, DedicatedNode]. (default "SharedNode")
--termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Halt, Delete, WipeOut]. (default "Delete")
--tolerations strings Tolerations for cluster, such as "key=value:effect,key:effect", for example '"engineType=mongo:NoSchedule", "diskType:NoSchedule"'
--topology-keys stringArray Topology keys for affinity
--version string Cluster version. (default "ac-mysql-8.0.30")
--cpu float CPU cores. Value range [0.5, 64]. (default 0.5)
--disable-exporter Enable or disable monitor. (default true)
--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")
--edit Edit the API resource before creating
--etcd.local.etcdctl-api string (default "3")
--etcd.local.replicas int Value range [1, 3]. (default 3)
--etcd.local.resources.storage string (default "20Gi")
--etcd.local.service-version string (default "3.5.6")
--etcd.mode string Legal values [serviceRef, local]. (default "local")
--etcd.service-ref.cluster.component string (default "etcd")
--etcd.service-ref.cluster.credential string
--etcd.service-ref.cluster.name string
--etcd.service-ref.cluster.port string (default "client")
--etcd.service-ref.cluster.service string (default "headless")
--etcd.service-ref.namespace string (default "default")
--etcd.service-ref.service-descriptor string
-h, --help help for apecloud-mysql
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5)
--mode string Cluster topology mode. Legal values [standalone, raftGroup]. (default "standalone")
--node-labels stringToString Node label selector (default [])
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--pod-anti-affinity string Pod anti-affinity type, one of: (Preferred, Required) (default "Preferred")
--proxy-enabled Enable proxy or not.
--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)
--storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20)
--storage-class-name string Storage class name of the data volume
--tenancy string Tenancy options, one of: (SharedNode, DedicatedNode) (default "SharedNode")
--termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Delete, WipeOut]. (default "Delete")
--tolerations strings Tolerations for cluster, such as "key=value:effect,key:effect", for example '"engineType=mongo:NoSchedule", "diskType:NoSchedule"'
--topology-keys stringArray Topology keys for affinity
--version string MySQL Service Version. (default "8.0.30")
```

### Options inherited from parent commands
Expand Down
29 changes: 0 additions & 29 deletions docs/user_docs/cli/kbcli_cluster_custom-ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,35 +57,6 @@ kbcli cluster custom-ops OpsDef --cluster <clusterName> <your custom params> [fl
### SEE ALSO

* [kbcli cluster](kbcli_cluster.md) - Cluster command.
* [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
* [kbcli cluster custom-ops hdfs-balancer](kbcli_cluster_custom-ops_hdfs-balancer.md) - Create a custom ops with opsDef hdfs-balancer
* [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
* [kbcli cluster custom-ops kafka-quota](kbcli_cluster_custom-ops_kafka-quota.md) - Create a custom ops with opsDef kafka-quota
* [kbcli cluster custom-ops kafka-topic](kbcli_cluster_custom-ops_kafka-topic.md) - Create a custom ops with opsDef kafka-topic
* [kbcli cluster custom-ops kafka-user-acl](kbcli_cluster_custom-ops_kafka-user-acl.md) - Create a custom ops with opsDef kafka-user-acl
* [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
* [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
* [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
* [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
* [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
* [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
* [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
* [kbcli cluster custom-ops nebula-balance-data](kbcli_cluster_custom-ops_nebula-balance-data.md) - Create a custom ops with opsDef nebula-balance-data
* [kbcli cluster custom-ops ob-alter-unit](kbcli_cluster_custom-ops_ob-alter-unit.md) - Create a custom ops with opsDef ob-alter-unit
* [kbcli cluster custom-ops ob-switch-configserver](kbcli_cluster_custom-ops_ob-switch-configserver.md) - Create a custom ops with opsDef ob-switch-configserver
* [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
* [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
* [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
* [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
* [kbcli cluster custom-ops redis-cluster-rebalance](kbcli_cluster_custom-ops_redis-cluster-rebalance.md) - Create a custom ops with opsDef redis-cluster-rebalance
* [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
* [kbcli cluster custom-ops redis-reset-master](kbcli_cluster_custom-ops_redis-reset-master.md) - Create a custom ops with opsDef redis-reset-master
* [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
* [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
* [kbcli cluster custom-ops remove-remote-arch](kbcli_cluster_custom-ops_remove-remote-arch.md) - Create a custom ops with opsDef remove-remote-arch
* [kbcli cluster custom-ops switchover-for-dm](kbcli_cluster_custom-ops_switchover-for-dm.md) - Create a custom ops with opsDef switchover-for-dm
* [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
* [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

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

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/apecloud/kbcli

go 1.24.0
go 1.25.0

toolchain go1.24.9
toolchain go1.25.10

require (
cuelang.org/go v0.8.0
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/kubeblocks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func configKBRelease(o *InstallOptions) error {
if kbRelease != nil && kbRelease.Chart != nil && kbRelease.Chart.Metadata != nil {
kbVersion = kbRelease.Chart.Metadata.Version
}
s := spinner.New(o.Out, spinnerMsg("Config KubeBlocks "+kbVersion))
s := spinner.New(o.Out, spinnerMsg("Config KubeBlocks %s", kbVersion))
defer s.Fail()
o.disableHelmPreHookJob()
// upgrade KubeBlocks chart
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/kubeblocks/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func (o *InstallOptions) Install() error {
s.Success()

// add helm repo
s = spinner.New(o.Out, spinnerMsg("Add and update repo "+types.KubeBlocksRepoName))
s = spinner.New(o.Out, spinnerMsg("Add and update repo %s", types.KubeBlocksRepoName))
defer s.Fail()
// Add repo, if exists, will update it
if err = helm.AddRepo(newHelmRepoEntry()); err != nil {
Expand All @@ -308,7 +308,7 @@ func (o *InstallOptions) Install() error {
s.Success()

// install KubeBlocks
s = spinner.New(o.Out, spinnerMsg("Install KubeBlocks "+o.Version))
s = spinner.New(o.Out, spinnerMsg("Install KubeBlocks %s", o.Version))
defer s.Fail()

getImageRegistry := func() string {
Expand Down Expand Up @@ -460,7 +460,7 @@ func (o *InstallOptions) waitAddonsEnabled() error {
msg := ""
header := "Wait for addons to be enabled"
failedErr := errors.New("some addons are failed to be enabled")
s := spinner.New(o.Out, spinnerMsg(header))
s := spinner.New(o.Out, spinnerMsg("Wait for addons to be enabled"))

var (
spinnerDone = func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/kubeblocks/install_1.0.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (o *InstallOptions) preInstallWhenUpgradeFrom09() error {
deploy := &kbDeploys[i]
kbVersion := deploy.Labels[constant.AppVersionLabelKey]
o.kb09Namespace = deploy.Namespace
s := spinner.New(o.Out, spinnerMsg(fmt.Sprintf("Stop %s %s", msgKey, kbVersion)))
s := spinner.New(o.Out, spinnerMsg("Stop %s %s", msgKey, kbVersion))
if err = o.stopDeploymentObject(s, deploy); err != nil {
return err
}
Expand Down
Loading
Loading