Skip to content

Commit 6012c41

Browse files
committed
Merge branch 'main' into feature/config-manager-migration-phase3-kbagent-integratio
2 parents c2f8bc2 + a54d6f6 commit 6012c41

File tree

17 files changed

+72
-84
lines changed

17 files changed

+72
-84
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
strategy:
8181
fail-fast: true
8282
matrix:
83-
ops: [ 'manifests', 'mod-vendor', 'generate', 'lint', 'staticcheck', 'test' ]
83+
ops: [ 'manifests', 'mod-vendor', 'generate', 'lint', 'test' ]
8484
steps:
8585
- uses: actions/checkout@v4
8686
- name: install lib
@@ -99,7 +99,7 @@ jobs:
9999
- name: Install golangci-lint
100100
if: matrix.ops == 'lint'
101101
run: |
102-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.5
102+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.0
103103
104104
- name: make ${{ matrix.ops }}
105105
run: |

.github/workflows/cicd-push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
strategy:
106106
fail-fast: true
107107
matrix:
108-
ops: [ 'manifests', 'mod-vendor', 'generate', 'lint', 'staticcheck', 'test' ]
108+
ops: [ 'manifests', 'mod-vendor', 'generate', 'lint', 'test' ]
109109
steps:
110110
- uses: actions/checkout@v4
111111
- name: install lib
@@ -124,7 +124,7 @@ jobs:
124124
- name: Install golangci-lint
125125
if: matrix.ops == 'lint'
126126
run: |
127-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.5
127+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.0
128128
129129
- name: make ${{ matrix.ops }}
130130
run: |

.github/workflows/release-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
fail-fast: true
3030
matrix:
31-
ops: [ 'manifests', 'mod-vendor', 'generate', 'lint', 'staticcheck', 'test' ]
31+
ops: [ 'manifests', 'mod-vendor', 'generate', 'lint', 'test' ]
3232
steps:
3333
- uses: actions/checkout@v4
3434
- name: install lib
@@ -47,7 +47,7 @@ jobs:
4747
- name: Install golangci-lint
4848
if: matrix.ops == 'lint'
4949
run: |
50-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.5
50+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.0
5151
5252
- name: make ${{ matrix.ops }}
5353
run: |

.golangci.yaml

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,54 @@
1-
# options for analysis running
1+
version: "2"
22
run:
3-
# default concurrency is a available CPU number
4-
concurrency: 4
5-
6-
# timeout for analysis, e.g. 30s, 5m, default is 1m
7-
deadline: 15m
8-
9-
timeout: 30m
10-
11-
issues:
12-
exclude-files:
13-
- "^zz_generated.*"
14-
15-
# build-tags:
16-
# - containers_image_openpgp
17-
183
output:
19-
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
204
formats:
21-
- format: colored-line-number
5+
text:
226
path: stdout
23-
24-
# print lines of code with issue, default is true
25-
print-issued-lines: true
26-
27-
# print linter name in the end of issue text, default is true
28-
print-linter-name: true
29-
30-
# check available linters @ https://golangci-lint.run/usage/linters/
7+
print-linter-name: true
8+
print-issued-lines: true
319
linters:
32-
disable-all: true
33-
enable: # please keep this alphabetized
34-
# - gocyclo
35-
- loggercheck
10+
default: none
11+
enable:
3612
- errcheck
3713
- gocritic
38-
# - goconst
39-
- goimports
40-
- gofmt # We enable this as well as goimports for its simplify mode.
41-
- gosimple
4214
- govet
4315
- ineffassign
44-
- typecheck
16+
- loggercheck
4517
- misspell
4618
- nakedret
19+
- staticcheck
4720
- unconvert
4821
- unused
49-
50-
linters-settings:
51-
errcheck:
52-
check-blank: false # to keep `_ = viper.BindPFlag(...)` from throwing errors
22+
settings:
23+
errcheck:
24+
check-blank: false
25+
staticcheck:
26+
checks:
27+
- all
28+
- '-ST1001' # Dot imports are discouraged
29+
- '-SA1019' # Using a deprecated function, variable, constant or field
30+
- '-QF1008' # Omit embedded fields from selector expression
31+
- '-QF1001' # Apply De Morgan’s law
32+
exclusions:
33+
generated: lax
34+
presets:
35+
- comments
36+
- common-false-positives
37+
- legacy
38+
- std-error-handling
39+
paths:
40+
- ^zz_generated.*
41+
- third_party$
42+
- builtin$
43+
- examples$
44+
formatters:
45+
enable:
46+
- gofmt
47+
- goimports
48+
exclusions:
49+
generated: lax
50+
paths:
51+
- ^zz_generated.*
52+
- third_party$
53+
- builtin$
54+
- examples$

Makefile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ vet: test-go-generate ## Run go vet against code.
145145
GOOS=$(GOOS) $(GO) vet -mod=mod ./...
146146

147147
.PHONY: lint-fast
148-
lint-fast: staticcheck vet golangci-lint # [INTERNAL] Run all lint job against code.
148+
lint-fast: vet golangci-lint # [INTERNAL] Run all lint job against code.
149149

150150
.PHONY: lint
151151
lint: test-go-generate generate ## Run default lint job against code.
@@ -155,10 +155,6 @@ lint: test-go-generate generate ## Run default lint job against code.
155155
golangci-lint: golangci-lint-bin generate ## Run golangci-lint against code.
156156
$(GOLANGCILINT) run ./...
157157

158-
.PHONY: staticcheck
159-
staticcheck: staticcheck-bin test-go-generate generate ## Run staticcheck against code.
160-
$(STATICCHECK) ./...
161-
162158
.PHONY: build-checks
163159
build-checks: fmt vet goimports lint-fast ## Run build checks.
164160

@@ -386,7 +382,7 @@ controller-gen: $(LOCALBIN) ## Download controller-gen locally if necessary.
386382
envtest: $(LOCALBIN) ## Download envtest-setup locally if necessary.
387383
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
388384

389-
GOLANGCILINT_VERSION = v1.64.8
385+
GOLANGCILINT_VERSION = v2.8.0
390386
GOLANGCILINT = $(LOCALBIN)/golangci-lint-$(GOLANGCILINT_VERSION)
391387
.PHONY: golangci-lint-bin
392388
golangci-lint-bin: $(LOCALBIN) ## Download golangci-lint locally if necessary.
@@ -396,12 +392,6 @@ golangci-lint-bin: $(LOCALBIN) ## Download golangci-lint locally if necessary.
396392
mv "$(LOCALBIN)/golangci-lint" "$(GOLANGCILINT)"; \
397393
}
398394

399-
STATICCHECK_VERSION = v0.6.1
400-
STATICCHECK = $(LOCALBIN)/staticcheck-$(STATICCHECK_VERSION)
401-
.PHONY: staticcheck-bin
402-
staticcheck-bin: $(LOCALBIN) ## Download staticcheck locally if necessary.
403-
$(call go-install-tool,$(STATICCHECK),honnef.co/go/tools/cmd/staticcheck,$(STATICCHECK_VERSION))
404-
405395
GOIMPORTS_VERSION = v0.34.0
406396
GOIMPORTS = $(LOCALBIN)/goimports-$(GOIMPORTS_VERSION)
407397
.PHONY: goimports-bin

apis/apps/v1alpha1/type.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ type ConfigTemplateExtension struct {
109109
}
110110

111111
// LegacyRenderedTemplateSpec describes the configuration extension for the lazy rendered template.
112+
//
112113
// Deprecated: LegacyRenderedTemplateSpec has been deprecated since 0.9.0 and will be removed in 0.10.0
113114
type LegacyRenderedTemplateSpec struct {
114115
// Extends the configuration template.

apis/workloads/v1alpha1/instanceset_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
2828

2929
// SchedulingPolicy the scheduling policy.
30+
//
3031
// Deprecated: Unify with apps/v1alpha1.SchedulingPolicy
3132
type SchedulingPolicy struct {
3233
// If specified, the Pod will be dispatched by specified scheduler.

controllers/trace/reconciler_tree.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,10 @@ func (r *jobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
653653
}
654654
// Update job status based on pod completion
655655
if err = r.Get(ctx, client.ObjectKeyFromObject(pod), pod); err == nil {
656-
if pod.Status.Phase == corev1.PodSucceeded {
656+
switch pod.Status.Phase {
657+
case corev1.PodSucceeded:
657658
job.Status.Succeeded++
658-
} else if pod.Status.Phase == corev1.PodFailed {
659+
case corev1.PodFailed:
659660
job.Status.Failed++
660661
}
661662
}

docker/Dockerfile-dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ARG INSTALL_ZSH="true"
1414
ARG KUBECTL_VERSION="latest"
1515
ARG HELM_VERSION="latest"
1616
ARG MINIKUBE_VERSION="latest"
17-
ARG GOLANGCI_LINT_VERSION="1.64.5"
17+
ARG GOLANGCI_LINT_VERSION="2.8.0"
1818

1919
ARG USERNAME=kubeblocks
2020
ARG USER_UID=1000

docs/developer_docs/api-reference/cluster.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25053,8 +25053,8 @@ It is required when the issuer is set to <code>UserProvided</code>.</p>
2505325053
(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.ComponentConfigSpec">ComponentConfigSpec</a>)
2505425054
</p>
2505525055
<div>
25056-
<p>LegacyRenderedTemplateSpec describes the configuration extension for the lazy rendered template.
25057-
Deprecated: LegacyRenderedTemplateSpec has been deprecated since 0.9.0 and will be removed in 0.10.0</p>
25056+
<p>LegacyRenderedTemplateSpec describes the configuration extension for the lazy rendered template.</p>
25057+
<p>Deprecated: LegacyRenderedTemplateSpec has been deprecated since 0.9.0 and will be removed in 0.10.0</p>
2505825058
</div>
2505925059
<table>
2506025060
<thead>
@@ -36411,8 +36411,8 @@ RoleUpdateMechanism
3641136411
(<em>Appears on:</em><a href="#workloads.kubeblocks.io/v1alpha1.InstanceTemplate">InstanceTemplate</a>)
3641236412
</p>
3641336413
<div>
36414-
<p>SchedulingPolicy the scheduling policy.
36415-
Deprecated: Unify with apps/v1alpha1.SchedulingPolicy</p>
36414+
<p>SchedulingPolicy the scheduling policy.</p>
36415+
<p>Deprecated: Unify with apps/v1alpha1.SchedulingPolicy</p>
3641636416
</div>
3641736417
<table>
3641836418
<thead>

0 commit comments

Comments
 (0)