mirror of
https://github.com/clastix/kamaji.git
synced 2026-02-14 10:00:02 +00:00
chore(go): upgrading to 1.24 (#766)
* chore(go): upgrading to 1.24 Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> * chore(ci): building golanci-lint from source * chore(golangci-lint): aligning to v2 release Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> --------- Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
This commit is contained in:
committed by
GitHub
parent
0f3de13d26
commit
b2ec531183
12
.github/workflows/ci.yaml
vendored
12
.github/workflows/ci.yaml
vendored
@@ -25,11 +25,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
- name: Run golangci-lint
|
- name: Run golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v6.5.2
|
run: make golint
|
||||||
with:
|
# TODO(prometherion): enable back once golangci-lint is built from v1.24 rather than v1.23
|
||||||
version: v1.62.2
|
# uses: golangci/golangci-lint-action@v6.5.2
|
||||||
only-new-issues: false
|
# with:
|
||||||
args: --config .golangci.yml
|
# version: v1.62.2
|
||||||
|
# only-new-issues: false
|
||||||
|
# args: --config .golangci.yml
|
||||||
diff:
|
diff:
|
||||||
name: diff
|
name: diff
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|||||||
117
.golangci.yml
117
.golangci.yml
@@ -1,53 +1,76 @@
|
|||||||
run:
|
version: "2"
|
||||||
timeout: 10m
|
|
||||||
|
|
||||||
linters-settings:
|
|
||||||
revive:
|
|
||||||
rules:
|
|
||||||
- name: dot-imports
|
|
||||||
arguments:
|
|
||||||
- allowedPackages:
|
|
||||||
- "github.com/onsi/ginkgo/v2"
|
|
||||||
- "github.com/onsi/gomega"
|
|
||||||
gci:
|
|
||||||
sections:
|
|
||||||
- standard
|
|
||||||
- default
|
|
||||||
- prefix(github.com/clastix/kamaji/)
|
|
||||||
goheader:
|
|
||||||
template: |-
|
|
||||||
Copyright 2022 Clastix Labs
|
|
||||||
SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
|
default: all
|
||||||
disable:
|
disable:
|
||||||
- depguard
|
|
||||||
- wrapcheck
|
|
||||||
- mnd
|
|
||||||
- varnamelen
|
|
||||||
- testpackage
|
|
||||||
- tagliatelle
|
|
||||||
- paralleltest
|
|
||||||
- ireturn
|
|
||||||
- err113
|
|
||||||
- gochecknoglobals
|
|
||||||
- wsl
|
|
||||||
- exhaustive
|
|
||||||
- nosprintfhostport
|
|
||||||
- nonamedreturns
|
|
||||||
- interfacebloat
|
|
||||||
- exhaustruct
|
|
||||||
- lll
|
|
||||||
- gosec
|
|
||||||
- gomoddirectives
|
|
||||||
- godox
|
|
||||||
- gochecknoinits
|
|
||||||
- funlen
|
|
||||||
- dupl
|
|
||||||
- cyclop
|
- cyclop
|
||||||
|
- depguard
|
||||||
|
- dupl
|
||||||
|
- err113
|
||||||
|
- exhaustive
|
||||||
|
- exhaustruct
|
||||||
|
- funlen
|
||||||
|
- gochecknoglobals
|
||||||
|
- gochecknoinits
|
||||||
- gocognit
|
- gocognit
|
||||||
|
- godox
|
||||||
|
- gomoddirectives
|
||||||
|
- gosec
|
||||||
|
- interfacebloat
|
||||||
|
- ireturn
|
||||||
|
- lll
|
||||||
|
- mnd
|
||||||
- nestif
|
- nestif
|
||||||
|
- nonamedreturns
|
||||||
|
- nosprintfhostport
|
||||||
|
- paralleltest
|
||||||
- perfsprint
|
- perfsprint
|
||||||
# deprecated linters
|
- tagliatelle
|
||||||
- exportloopref
|
- testpackage
|
||||||
enable-all: true
|
- varnamelen
|
||||||
|
- wrapcheck
|
||||||
|
- wsl
|
||||||
|
settings:
|
||||||
|
staticcheck:
|
||||||
|
checks:
|
||||||
|
- all
|
||||||
|
- -QF1008
|
||||||
|
goheader:
|
||||||
|
template: |-
|
||||||
|
Copyright 2022 Clastix Labs
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
revive:
|
||||||
|
rules:
|
||||||
|
- name: dot-imports
|
||||||
|
arguments:
|
||||||
|
- allowedPackages:
|
||||||
|
- github.com/onsi/ginkgo/v2
|
||||||
|
- github.com/onsi/gomega
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
presets:
|
||||||
|
- comments
|
||||||
|
- common-false-positives
|
||||||
|
- legacy
|
||||||
|
- std-error-handling
|
||||||
|
paths:
|
||||||
|
- third_party$
|
||||||
|
- builtin$
|
||||||
|
- examples$
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gci
|
||||||
|
- gofmt
|
||||||
|
- gofumpt
|
||||||
|
- goimports
|
||||||
|
settings:
|
||||||
|
gci:
|
||||||
|
sections:
|
||||||
|
- standard
|
||||||
|
- default
|
||||||
|
- prefix(github.com/clastix/kamaji/)
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
paths:
|
||||||
|
- third_party$
|
||||||
|
- builtin$
|
||||||
|
- examples$
|
||||||
2
Makefile
2
Makefile
@@ -103,7 +103,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
|
|||||||
.PHONY: golangci-lint
|
.PHONY: golangci-lint
|
||||||
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
|
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
|
||||||
$(GOLANGCI_LINT): $(LOCALBIN)
|
$(GOLANGCI_LINT): $(LOCALBIN)
|
||||||
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
|
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.0.2
|
||||||
|
|
||||||
.PHONY: apidocs-gen
|
.PHONY: apidocs-gen
|
||||||
apidocs-gen: $(APIDOCS_GEN) ## Download crdoc locally if necessary.
|
apidocs-gen: $(APIDOCS_GEN) ## Download crdoc locally if necessary.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ var _ = Describe("Cluster controller", func() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
ctx = context.Background() //nolint:fatcontext
|
ctx = context.Background()
|
||||||
tcp = &TenantControlPlane{
|
tcp = &TenantControlPlane{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "tcp",
|
Name: "tcp",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ var _ = Describe("Datastores validation test", func() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
ctx = context.Background() //nolint:fatcontext
|
ctx = context.Background()
|
||||||
ds = &DataStore{
|
ds = &DataStore{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "ds",
|
Name: "ds",
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -1,6 +1,6 @@
|
|||||||
module github.com/clastix/kamaji
|
module github.com/clastix/kamaji
|
||||||
|
|
||||||
go 1.23.0
|
go 1.24
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/JamesStewy/go-mysqldump v0.2.2
|
github.com/JamesStewy/go-mysqldump v0.2.2
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ var _ = Describe("DatastoreStorageConfig", func() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
ctx = context.Background() //nolint:fatcontext
|
ctx = context.Background()
|
||||||
|
|
||||||
tcp = &kamajiv1alpha1.TenantControlPlane{
|
tcp = &kamajiv1alpha1.TenantControlPlane{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ var _ = Describe("TCP Defaulting Webhook", func() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
ctx = context.Background() //nolint:fatcontext
|
ctx = context.Background()
|
||||||
})
|
})
|
||||||
|
|
||||||
Describe("fields missing", func() {
|
Describe("fields missing", func() {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ var _ = Describe("TCP LoadBalancer Source Ranges Webhook", func() {
|
|||||||
},
|
},
|
||||||
Spec: kamajiv1alpha1.TenantControlPlaneSpec{},
|
Spec: kamajiv1alpha1.TenantControlPlaneSpec{},
|
||||||
}
|
}
|
||||||
ctx = context.Background() //nolint:fatcontext
|
ctx = context.Background()
|
||||||
})
|
})
|
||||||
|
|
||||||
It("allows creation when valid CIDR ranges are provided", func() {
|
It("allows creation when valid CIDR ranges are provided", func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user