Skip to content

Commit 165b0f8

Browse files
mjudeikis-botmjudeikismjudeikis-bot
authored
🌱 rebase to k/k 1.35 (#75)
* rebase to k/k 1.35 * fix: add missing Apache 2.0 boilerplate headers Files added in the k/k 1.35 rebase were missing the required Apache 2.0 license boilerplate headers, causing verify-boilerplate CI check to fail. Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: handle OverrideDefault errors to satisfy errcheck linter Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: replace broken pr-verifier Docker image with inline check The pr-verifier workflow used gcr.io/kubebuilder/pr-verifier:v0.4.3 which is no longer available on Google Container Registry, causing the 'verify PR contents' CI check to always fail with: manifest unknown: Failed to fetch "v0.4.3" Replace with an equivalent inline shell step that checks the PR title format directly, without requiring an external Docker image. Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * chore: remove pr-verifier workflow The gcr.io/kubebuilder/pr-verifier:v0.4.3 Docker image is no longer available and the workflow has been breaking all PRs. Removing it entirely. Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: bump golangci-lint v1.54.2 → v1.64.8 v1.54.2 depends on go.tmz.dev/musttag which is no longer resolvable, causing the lint CI job to fail at install time. Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: upgrade golangci-lint to v2 and fix all lint issues - Bump golangci-lint v1.54.2 → v2.10.1 (v1.54.2 has dead dependency go.tmz.dev/musttag causing install failures) - Add .golangci.yml with version: "2" config - Fix revive lints: stutter (BatteriesList→List), receiver-naming, unused-parameter, blank-imports (add comments) - Fix staticcheck QF1008: remove redundant embedded field selectors Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: fix golangci-lint v2 module path and resolve all lint/verify issues - Fix golangci-lint install: v2 uses module path .../v2/cmd/golangci-lint - Update .golangci.yml: disable blank-imports revive rule (conflicts with goimports import ordering) - Strip inline comments from blank imports (goimports can't handle them) - All checks pass: boilerplate, verify-imports, lint, build Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: bump staticcheck 2023.1 → 2025.1 for Go 1.25 support staticcheck 2023.1 fails with 'invalid Go version: 1.25.0'. 2025.1 supports Go 1.25+. Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: switch golangci-lint install to binary download via uget.sh Using 'go install' for golangci-lint v2 failed in prow because the Go toolchain version requirement caused install failures. Switch to downloading the pre-built binary directly from GitHub Releases, matching how kcp manages golangci-lint. Also removes the 'v' prefix from GOLANGCI_LINT_VER (uget.sh uses version without 'v' in the download URL). Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: add KCP boilerplate to uget.sh and gitignore coverage.txt - hack/uget.sh was missing the required Apache 2.0 boilerplate header - coverage.txt was not gitignored, causing verify-imports to fail when make test was run before make verify-imports Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: make test depend on gotestsum so it installs before running When USE_GOTESTSUM=1 (set by prow), make test uses the gotestsum binary. Without it as a Makefile dependency it fails with 'command not found'. Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: bump gotestsum v1.8.1 → v1.13.0 v1.8.1 failed to install in prow with 'No such file or directory'. v1.13.0 is the latest stable and installs correctly. Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> * fix: untrack coverage.txt and add to .gitignore coverage.txt was tracked by git, so running make test would generate it and cause verify-imports to fail (git diff sees the changed file). Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> --------- Signed-off-by: mjudeikis-bot <mjudeikis-bot@faros.sh> Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt> Co-authored-by: mjudeikis-bot <mjudeikis-bot@faros.sh>
1 parent 56987ee commit 165b0f8

20 files changed

Lines changed: 1104 additions & 569 deletions

File tree

.github/workflows/pr-verifier.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
vendor
55
hack/tools/*
66
bin/gcp
7+
coverage.txt

.golangci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: "2"
2+
run:
3+
allow-parallel-runners: true
4+
linters:
5+
default: none
6+
enable:
7+
- errcheck
8+
- govet
9+
- ineffassign
10+
- staticcheck
11+
- unused
12+
- misspell
13+
- gosec
14+
- revive
15+
settings:
16+
revive:
17+
rules:
18+
- name: blank-imports
19+
disabled: true
20+
- name: unused-parameter
21+
- name: receiver-naming
22+
- name: error-strings
23+
exclusions:
24+
presets:
25+
- comments
26+
- common-false-positives
27+
- std-error-handling
28+
rules:
29+
- linters:
30+
- gosec
31+
path: ".*_test\\.go"
32+
issues:
33+
max-issues-per-linter: 0
34+
max-same-issues: 0

.prow.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ presubmits:
77
preset-goproxy: "true"
88
spec:
99
containers:
10-
- image: ghcr.io/kcp-dev/infra/build:1.23.7-1
10+
- image: ghcr.io/kcp-dev/infra/build:1.25.0-1
1111
command:
1212
- make
1313
- verify-boilerplate
@@ -25,7 +25,7 @@ presubmits:
2525
preset-goproxy: "true"
2626
spec:
2727
containers:
28-
- image: ghcr.io/kcp-dev/infra/build:1.23.7-1
28+
- image: ghcr.io/kcp-dev/infra/build:1.25.0-1
2929
command:
3030
- make
3131
- lint
@@ -64,7 +64,7 @@ presubmits:
6464
preset-goproxy: "true"
6565
spec:
6666
containers:
67-
- image: ghcr.io/kcp-dev/infra/build:1.23.7-1
67+
- image: ghcr.io/kcp-dev/infra/build:1.25.0-1
6868
command:
6969
- make
7070
- test

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
# Build the binary
18-
FROM --platform=${BUILDPLATFORM} docker.io/golang:1.23.7 AS builder
18+
FROM --platform=${BUILDPLATFORM} docker.io/golang:1.25.0 AS builder
1919
WORKDIR /workspace
2020

2121
# Install dependencies.

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ OPENSHIFT_GOIMPORTS_BIN := openshift-goimports
4444
OPENSHIFT_GOIMPORTS := $(TOOLS_DIR)/$(OPENSHIFT_GOIMPORTS_BIN)-$(OPENSHIFT_GOIMPORTS_VER)
4545
export OPENSHIFT_GOIMPORTS # so hack scripts can use it
4646

47-
GOLANGCI_LINT_VER := v1.54.2
47+
GOLANGCI_LINT_VER := 2.10.1
4848
GOLANGCI_LINT_BIN := golangci-lint
4949
GOLANGCI_LINT := $(TOOLS_GOBIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)
5050

51-
STATICCHECK_VER := 2023.1
51+
STATICCHECK_VER := 2025.1
5252
STATICCHECK_BIN := staticcheck
5353
STATICCHECK := $(TOOLS_GOBIN_DIR)/$(STATICCHECK_BIN)-$(STATICCHECK_VER)
5454

55-
GOTESTSUM_VER := v1.8.1
55+
GOTESTSUM_VER := v1.13.0
5656
GOTESTSUM_BIN := gotestsum
5757
GOTESTSUM := $(abspath $(TOOLS_DIR))/$(GOTESTSUM_BIN)-$(GOTESTSUM_VER)
5858

@@ -112,7 +112,10 @@ install: require-jq require-go require-git verify-go-versions ## Install the pro
112112
.PHONY: install
113113

114114
$(GOLANGCI_LINT):
115-
GOBIN=$(TOOLS_GOBIN_DIR) $(GO_INSTALL) github.com/golangci/golangci-lint/cmd/golangci-lint $(GOLANGCI_LINT_BIN) $(GOLANGCI_LINT_VER)
115+
@UGET_DIRECTORY=$(TOOLS_GOBIN_DIR) UGET_VERSIONED_BINARIES=true hack/uget.sh \
116+
https://github.com/golangci/golangci-lint/releases/download/v{VERSION}/golangci-lint-{VERSION}-{GOOS}-{GOARCH}.tar.gz \
117+
$(GOLANGCI_LINT_BIN) \
118+
$(GOLANGCI_LINT_VER)
116119

117120
$(STATICCHECK):
118121
GOBIN=$(TOOLS_GOBIN_DIR) $(GO_INSTALL) honnef.co/go/tools/cmd/staticcheck $(STATICCHECK_BIN) $(STATICCHECK_VER)
@@ -154,7 +157,7 @@ endif
154157

155158
test: WHAT ?= ./...
156159
# We will need to move into the sub package, of sdk to run those tests.
157-
test: ## Run tests
160+
test: $(GOTESTSUM) ## Run tests
158161
$(GO_TEST) -race $(COUNT_ARG) -coverprofile=coverage.txt -covermode=atomic $(TEST_ARGS) $$(go list "$(WHAT)")
159162

160163
.PHONY: verify-imports

coverage.txt

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)