Skip to content

Commit db54ad7

Browse files
cert-manager-botinteon
authored andcommitted
BOT: run 'make upgrade-klone' and 'make generate'
Signed-off-by: cert-manager-bot <[email protected]>
1 parent df69a60 commit db54ad7

File tree

8 files changed

+98
-59
lines changed

8 files changed

+98
-59
lines changed

.github/workflows/govulncheck.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
govulncheck:
1818
runs-on: ubuntu-latest
1919

20+
if: github.repository_owner == 'cert-manager'
21+
2022
steps:
2123
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2224
# Adding `fetch-depth: 0` makes sure tags are also fetched. We need

.golangci.yaml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
version: "2"
12
linters:
2-
# Explicitly define all enabled linters
3-
disable-all: true
3+
default: none
4+
exclusions:
5+
generated: lax
6+
presets: [comments, common-false-positives, legacy, std-error-handling]
7+
paths: [third_party$, builtin$, examples$]
8+
warn-unused: true
9+
settings:
10+
staticcheck:
11+
checks: ["all", "-ST1000", "-ST1001", "-ST1003", "-ST1005", "-ST1012", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-QF1001", "-QF1003", "-QF1008"]
412
enable:
513
- asasalint
614
- asciicheck
715
- bidichk
816
- bodyclose
17+
- canonicalheader
918
- contextcheck
1019
- copyloopvar
1120
- decorder
@@ -16,23 +25,22 @@ linters:
1625
- errchkjson
1726
- errname
1827
- exhaustive
28+
- exptostd
1929
- forbidigo
20-
- gci
2130
- ginkgolinter
2231
- gocheckcompilerdirectives
2332
- gochecksumtype
2433
- gocritic
25-
- gofmt
2634
- goheader
2735
- goprintffuncname
2836
- gosec
29-
- gosimple
3037
- gosmopolitan
3138
- govet
3239
- grouper
3340
- importas
3441
- ineffassign
3542
- interfacebloat
43+
- intrange
3644
- loggercheck
3745
- makezero
3846
- mirror
@@ -50,19 +58,23 @@ linters:
5058
- sloglint
5159
- staticcheck
5260
- tagalign
53-
- tenv
5461
- testableexamples
55-
- typecheck
5662
- unconvert
5763
- unparam
5864
- unused
5965
- usestdlibvars
66+
- usetesting
6067
- wastedassign
61-
linters-settings:
62-
gci:
63-
sections:
64-
- standard # Standard section: captures all standard packages.
65-
- default # Default section: contains all imports that could not be matched to another section type.
66-
- prefix(github.com/cert-manager/image-tool) # Custom section: groups all imports with the specified Prefix.
67-
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
68-
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
68+
formatters:
69+
enable: [gci, gofmt]
70+
settings:
71+
gci:
72+
sections:
73+
- standard # Standard section: captures all standard packages.
74+
- default # Default section: contains all imports that could not be matched to another section type.
75+
- prefix(github.com/cert-manager/image-tool) # Custom section: groups all imports with the specified Prefix.
76+
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
77+
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
78+
exclusions:
79+
generated: lax
80+
paths: [third_party$, builtin$, examples$]

klone.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,45 @@ targets:
1010
- folder_name: boilerplate
1111
repo_url: https://github.com/cert-manager/makefile-modules.git
1212
repo_ref: main
13-
repo_hash: 7740a28745d013a286c0573a180d0aa53ff0aa6a
13+
repo_hash: 01f8036da297256be41f6cc520cb248cb0f609fc
1414
repo_path: modules/boilerplate
1515
- folder_name: cert-manager
1616
repo_url: https://github.com/cert-manager/makefile-modules.git
1717
repo_ref: main
18-
repo_hash: 7740a28745d013a286c0573a180d0aa53ff0aa6a
18+
repo_hash: 01f8036da297256be41f6cc520cb248cb0f609fc
1919
repo_path: modules/cert-manager
2020
- folder_name: executable
2121
repo_url: https://github.com/cert-manager/makefile-modules.git
2222
repo_ref: main
23-
repo_hash: 7740a28745d013a286c0573a180d0aa53ff0aa6a
23+
repo_hash: 01f8036da297256be41f6cc520cb248cb0f609fc
2424
repo_path: modules/executable
2525
- folder_name: generate-verify
2626
repo_url: https://github.com/cert-manager/makefile-modules.git
2727
repo_ref: main
28-
repo_hash: 7740a28745d013a286c0573a180d0aa53ff0aa6a
28+
repo_hash: 01f8036da297256be41f6cc520cb248cb0f609fc
2929
repo_path: modules/generate-verify
3030
- folder_name: go
3131
repo_url: https://github.com/cert-manager/makefile-modules.git
3232
repo_ref: main
33-
repo_hash: 7740a28745d013a286c0573a180d0aa53ff0aa6a
33+
repo_hash: 01f8036da297256be41f6cc520cb248cb0f609fc
3434
repo_path: modules/go
3535
- folder_name: help
3636
repo_url: https://github.com/cert-manager/makefile-modules.git
3737
repo_ref: main
38-
repo_hash: 7740a28745d013a286c0573a180d0aa53ff0aa6a
38+
repo_hash: 01f8036da297256be41f6cc520cb248cb0f609fc
3939
repo_path: modules/help
4040
- folder_name: klone
4141
repo_url: https://github.com/cert-manager/makefile-modules.git
4242
repo_ref: main
43-
repo_hash: 7740a28745d013a286c0573a180d0aa53ff0aa6a
43+
repo_hash: 01f8036da297256be41f6cc520cb248cb0f609fc
4444
repo_path: modules/klone
4545
- folder_name: repository-base
4646
repo_url: https://github.com/cert-manager/makefile-modules.git
4747
repo_ref: main
48-
repo_hash: 7740a28745d013a286c0573a180d0aa53ff0aa6a
48+
repo_hash: 01f8036da297256be41f6cc520cb248cb0f609fc
4949
repo_path: modules/repository-base
5050
- folder_name: tools
5151
repo_url: https://github.com/cert-manager/makefile-modules.git
5252
repo_ref: main
53-
repo_hash: 7740a28745d013a286c0573a180d0aa53ff0aa6a
53+
repo_hash: 01f8036da297256be41f6cc520cb248cb0f609fc
5454
repo_path: modules/tools

make/_shared/generate-verify/util/verify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ trap "cleanup" EXIT SIGINT
5353
# 2. rsync on macOS 15.4 and newer is actually openrsync, which has different permissions and throws errors when copying git objects
5454
#
5555
# So, we use find to list all files except _bin, and then copy each in turn
56-
find . -maxdepth 1 -not \( -path "./_bin" -prune \) | xargs -I% cp -af "${projectdir}/%" "${tmp}/"
56+
find . -maxdepth 1 -not \( -path "./_bin" \) -not \( -path "." \) | xargs -I% cp -af "${projectdir}/%" "${tmp}/"
5757

5858
pushd "${tmp}" >/dev/null
5959

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
version: "2"
12
linters:
2-
# Explicitly define all enabled linters
3-
disable-all: true
3+
default: none
4+
exclusions:
5+
generated: lax
6+
presets: [ comments, common-false-positives, legacy, std-error-handling ]
7+
paths: [ third_party$, builtin$, examples$ ]
8+
warn-unused: true
9+
settings:
10+
staticcheck:
11+
checks: [ "all", "-ST1000", "-ST1001", "-ST1003", "-ST1005", "-ST1012", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-QF1001", "-QF1003", "-QF1008" ]
412
enable:
513
- asasalint
614
- asciicheck
715
- bidichk
816
- bodyclose
17+
- canonicalheader
918
- contextcheck
1019
- copyloopvar
1120
- decorder
@@ -16,23 +25,22 @@ linters:
1625
- errchkjson
1726
- errname
1827
- exhaustive
28+
- exptostd
1929
- forbidigo
20-
- gci
2130
- ginkgolinter
2231
- gocheckcompilerdirectives
2332
- gochecksumtype
2433
- gocritic
25-
- gofmt
2634
- goheader
2735
- goprintffuncname
2836
- gosec
29-
- gosimple
3037
- gosmopolitan
3138
- govet
3239
- grouper
3340
- importas
3441
- ineffassign
3542
- interfacebloat
43+
- intrange
3644
- loggercheck
3745
- makezero
3846
- mirror
@@ -50,19 +58,23 @@ linters:
5058
- sloglint
5159
- staticcheck
5260
- tagalign
53-
- tenv
5461
- testableexamples
55-
- typecheck
5662
- unconvert
5763
- unparam
5864
- unused
5965
- usestdlibvars
66+
- usetesting
6067
- wastedassign
61-
linters-settings:
62-
gci:
63-
sections:
64-
- standard # Standard section: captures all standard packages.
65-
- default # Default section: contains all imports that could not be matched to another section type.
66-
- prefix({{REPO-NAME}}) # Custom section: groups all imports with the specified Prefix.
67-
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
68-
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
68+
formatters:
69+
enable: [ gci, gofmt ]
70+
settings:
71+
gci:
72+
sections:
73+
- standard # Standard section: captures all standard packages.
74+
- default # Default section: contains all imports that could not be matched to another section type.
75+
- prefix({{REPO-NAME}}) # Custom section: groups all imports with the specified Prefix.
76+
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
77+
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
78+
exclusions:
79+
generated: lax
80+
paths: [ third_party$, builtin$, examples$ ]

make/_shared/go/01_mod.mk

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ ifdef golangci_lint_config
101101
.PHONY: generate-golangci-lint-config
102102
## Generate a golangci-lint configuration file
103103
## @category [shared] Generate/ Verify
104-
generate-golangci-lint-config: | $(NEEDS_YQ) $(bin_dir)/scratch
104+
generate-golangci-lint-config: | $(NEEDS_GOLANGCI-LINT) $(NEEDS_YQ) $(bin_dir)/scratch
105+
if [ "$$($(YQ) eval 'has("version") | not' $(golangci_lint_config))" == "true" ]; then \
106+
$(GOLANGCI-LINT) migrate -c $(golangci_lint_config); \
107+
rm $(basename $(golangci_lint_config)).bck$(suffix $(golangci_lint_config)); \
108+
fi
109+
105110
cp $(golangci_lint_config) $(bin_dir)/scratch/golangci-lint.yaml.tmp
106111
$(YQ) -i 'del(.linters.enable)' $(bin_dir)/scratch/golangci-lint.yaml.tmp
107112
$(YQ) eval-all -i '. as $$item ireduce ({}; . * $$item)' $(bin_dir)/scratch/golangci-lint.yaml.tmp $(golangci_lint_override)
@@ -119,9 +124,9 @@ verify-golangci-lint: | $(NEEDS_GO) $(NEEDS_GOLANGCI-LINT) $(NEEDS_YQ) $(bin_dir
119124
@find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \
120125
| while read d; do \
121126
target=$$(dirname $${d}); \
122-
echo "Running '$(bin_dir)/tools/golangci-lint run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config) --timeout $(golangci_lint_timeout)' in directory '$${target}'"; \
127+
echo "Running 'GOVERSION=$(VENDORED_GO_VERSION) $(bin_dir)/tools/golangci-lint run -c $(CURDIR)/$(golangci_lint_config) --timeout $(golangci_lint_timeout)' in directory '$${target}'"; \
123128
pushd "$${target}" >/dev/null; \
124-
$(GOLANGCI-LINT) run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config) --timeout $(golangci_lint_timeout) || exit; \
129+
GOVERSION=$(VENDORED_GO_VERSION) $(GOLANGCI-LINT) run -c $(CURDIR)/$(golangci_lint_config) --timeout $(golangci_lint_timeout) || exit; \
125130
popd >/dev/null; \
126131
echo ""; \
127132
done
@@ -132,21 +137,12 @@ shared_verify_targets_dirty += verify-golangci-lint
132137
## Fix all Go modules using golangci-lint
133138
## @category [shared] Generate/ Verify
134139
fix-golangci-lint: | $(NEEDS_GOLANGCI-LINT) $(NEEDS_YQ) $(NEEDS_GCI) $(bin_dir)/scratch
135-
$(GCI) write \
136-
--skip-generated \
137-
--skip-vendor \
138-
-s "standard" \
139-
-s "default" \
140-
-s "prefix($(repo_name))" \
141-
-s "blank" \
142-
-s "dot" .
143-
144140
@find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \
145141
| while read d; do \
146142
target=$$(dirname $${d}); \
147-
echo "Running '$(bin_dir)/tools/golangci-lint run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config) --fix' in directory '$${target}'"; \
143+
echo "Running 'GOVERSION=$(VENDORED_GO_VERSION) $(bin_dir)/tools/golangci-lint fmt -c $(CURDIR)/$(golangci_lint_config)' in directory '$${target}'"; \
148144
pushd "$${target}" >/dev/null; \
149-
$(GOLANGCI-LINT) run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config) --fix || exit; \
145+
GOVERSION=$(VENDORED_GO_VERSION) $(GOLANGCI-LINT) fmt -c $(CURDIR)/$(golangci_lint_config) || exit; \
150146
popd >/dev/null; \
151147
echo ""; \
152148
done

make/_shared/go/base/.github/workflows/govulncheck.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
govulncheck:
1818
runs-on: ubuntu-latest
1919

20+
if: github.repository_owner == 'cert-manager'
21+
2022
steps:
2123
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2224
# Adding `fetch-depth: 0` makes sure tags are also fetched. We need

make/_shared/tools/00_mod.mk

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@ endif
1818

1919
##########################################
2020

21-
export DOWNLOAD_DIR ?= $(CURDIR)/$(bin_dir)/downloaded
22-
export GOVENDOR_DIR ?= $(CURDIR)/$(bin_dir)/go_vendor
21+
default_shared_dir := $(CURDIR)/$(bin_dir)
22+
# If $(HOME) is set and $(CI) is not, use the $(HOME)/.cache
23+
# folder to store downloaded binaries.
24+
ifneq ($(shell printenv HOME),)
25+
ifeq ($(shell printenv CI),)
26+
default_shared_dir := $(HOME)/.cache/makefile-modules
27+
endif
28+
endif
29+
30+
export DOWNLOAD_DIR ?= $(default_shared_dir)/downloaded
31+
export GOVENDOR_DIR ?= $(default_shared_dir)/go_vendor
2332

2433
$(bin_dir)/tools $(DOWNLOAD_DIR)/tools:
2534
@mkdir -p $@
@@ -118,12 +127,14 @@ tools += goreleaser=v1.26.2
118127
tools += syft=v1.22.0
119128
# https://github.com/cert-manager/helm-tool/releases
120129
tools += helm-tool=v0.5.3
130+
# https://github.com/cert-manager/image-tool/releases
131+
tools += image-tool=v0.0.2
121132
# https://github.com/cert-manager/cmctl/releases
122133
tools += cmctl=v2.1.1
123134
# https://pkg.go.dev/github.com/cert-manager/release/cmd/cmrel?tab=versions
124135
tools += cmrel=e3cbe5171488deda000145003e22567bdce622ea
125-
# https://pkg.go.dev/github.com/golangci/golangci-lint/cmd/golangci-lint?tab=versions
126-
tools += golangci-lint=v1.64.8
136+
# https://pkg.go.dev/github.com/golangci/golangci-lint/v2/cmd/golangci-lint?tab=versions
137+
tools += golangci-lint=v2.1.2
127138
# https://pkg.go.dev/golang.org/x/vuln?tab=versions
128139
tools += govulncheck=v1.1.4
129140
# https://pkg.go.dev/github.com/operator-framework/operator-sdk/cmd/operator-sdk?tab=versions
@@ -136,6 +147,8 @@ tools += preflight=1.12.1
136147
tools += gci=v0.13.6
137148
# https://github.com/google/yamlfmt/releases
138149
tools += yamlfmt=v0.16.0
150+
# https://github.com/yannh/kubeconform/releases
151+
tools += kubeconform=v0.6.7
139152

140153
# https://pkg.go.dev/k8s.io/code-generator/cmd?tab=versions
141154
K8S_CODEGEN_VERSION := v0.32.3
@@ -334,14 +347,16 @@ go_dependencies += defaulter-gen=k8s.io/code-generator/cmd/defaulter-gen
334347
go_dependencies += conversion-gen=k8s.io/code-generator/cmd/conversion-gen
335348
go_dependencies += openapi-gen=k8s.io/kube-openapi/cmd/openapi-gen
336349
go_dependencies += helm-tool=github.com/cert-manager/helm-tool
350+
go_dependencies += image-tool=github.com/cert-manager/image-tool
337351
go_dependencies += cmctl=github.com/cert-manager/cmctl/v2
338352
go_dependencies += cmrel=github.com/cert-manager/release/cmd/cmrel
339-
go_dependencies += golangci-lint=github.com/golangci/golangci-lint/cmd/golangci-lint
353+
go_dependencies += golangci-lint=github.com/golangci/golangci-lint/v2/cmd/golangci-lint
340354
go_dependencies += govulncheck=golang.org/x/vuln/cmd/govulncheck
341355
go_dependencies += operator-sdk=github.com/operator-framework/operator-sdk/cmd/operator-sdk
342356
go_dependencies += gh=github.com/cli/cli/v2/cmd/gh
343357
go_dependencies += gci=github.com/daixiang0/gci
344358
go_dependencies += yamlfmt=github.com/google/yamlfmt/cmd/yamlfmt
359+
go_dependencies += kubeconform=github.com/yannh/kubeconform/cmd/kubeconform
345360

346361
#################
347362
# go build tags #

0 commit comments

Comments
 (0)