Skip to content

Commit c989e55

Browse files
committed
linter fix
1 parent c990d9c commit c989e55

16 files changed

Lines changed: 30 additions & 23 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ linters:
2828
- '-ST1001' # Dot imports are discouraged
2929
- '-SA1019' # Using a deprecated function, variable, constant or field
3030
- '-QF1008' # Omit embedded fields from selector expression
31+
- '-QF1001' # Apply De Morgan’s law
3132
exclusions:
3233
generated: lax
3334
presets:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ controller-gen: $(LOCALBIN) ## Download controller-gen locally if necessary.
386386
envtest: $(LOCALBIN) ## Download envtest-setup locally if necessary.
387387
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
388388

389-
GOLANGCILINT_VERSION = v1.64.8
389+
GOLANGCILINT_VERSION = v2.8.0
390390
GOLANGCILINT = $(LOCALBIN)/golangci-lint-$(GOLANGCILINT_VERSION)
391391
.PHONY: golangci-lint-bin
392392
golangci-lint-bin: $(LOCALBIN) ## Download golangci-lint locally if necessary.

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>
@@ -36399,8 +36399,8 @@ RoleUpdateMechanism
3639936399
(<em>Appears on:</em><a href="#workloads.kubeblocks.io/v1alpha1.InstanceTemplate">InstanceTemplate</a>)
3640036400
</p>
3640136401
<div>
36402-
<p>SchedulingPolicy the scheduling policy.
36403-
Deprecated: Unify with apps/v1alpha1.SchedulingPolicy</p>
36402+
<p>SchedulingPolicy the scheduling policy.</p>
36403+
<p>Deprecated: Unify with apps/v1alpha1.SchedulingPolicy</p>
3640436404
</div>
3640536405
<table>
3640636406
<thead>

0 commit comments

Comments
 (0)