Skip to content

Commit 48dc2f8

Browse files
authored
Merge pull request #286 from cychiang/bump-up-helm-version-to-fix-cve-issues
Fix CVE issues by bumping up helm version
2 parents 06246ee + c15165a commit 48dc2f8

File tree

5 files changed

+233
-337
lines changed

5 files changed

+233
-337
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
env:
1212
# Common versions
1313
GO_VERSION: '1.23'
14-
GOLANGCI_VERSION: 'v1.61.0'
14+
GOLANGCI_VERSION: 'v2.1.2'
1515
DOCKER_BUILDX_VERSION: 'v0.8.2'
1616

1717
jobs:
@@ -48,7 +48,7 @@ jobs:
4848
run: make vendor vendor.check
4949

5050
- name: Lint
51-
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
51+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
5252
with:
5353
version: ${{ env.GOLANGCI_VERSION }}
5454

.golangci.yml

Lines changed: 127 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -1,188 +1,141 @@
1-
# SPDX-FileCopyrightText: 2024 The Crossplane Authors <https://crossplane.io>
1+
# SPDX-FileCopyrightText: 2025 The Crossplane Authors <https://crossplane.io>
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

5-
run:
6-
timeout: 10m
7-
5+
version: "2"
86
output:
9-
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
107
formats:
11-
- format: colored-line-number
12-
13-
linters-settings:
14-
errcheck:
15-
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
16-
# default is false: such cases aren't reported by default.
17-
check-type-assertions: false
18-
19-
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
20-
# default is false: such cases aren't reported by default.
21-
check-blank: false
22-
23-
exclude-functions:
24-
- io/ioutil.ReadFile
25-
- io/ioutil.ReadDir
26-
- io/ioutil.ReadAll
27-
28-
govet:
29-
# report about shadowed variables
30-
check-shadowing: false
31-
32-
revive:
33-
# confidence for issues, default is 0.8
34-
confidence: 0.8
35-
36-
gofmt:
37-
# simplify code: gofmt with `-s` option, true by default
38-
simplify: true
39-
40-
goimports:
41-
# put imports beginning with prefix after 3rd-party packages;
42-
# it's a comma-separated list of prefixes
43-
local-prefixes: github.com/crossplane-contrib/provider-helm
44-
45-
gocyclo:
46-
# minimal code complexity to report, 30 by default (but we recommend 10-20)
47-
min-complexity: 15
48-
49-
dupl:
50-
# tokens count to trigger issue, 150 by default
51-
threshold: 100
52-
53-
goconst:
54-
# minimal length of string constant, 3 by default
55-
min-len: 3
56-
# minimal occurrences count to trigger, 3 by default
57-
min-occurrences: 5
58-
59-
lll:
60-
# tab width in spaces. Default to 1.
61-
tab-width: 1
62-
63-
unparam:
64-
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
65-
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
66-
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
67-
# with golangci-lint call it on a directory with the changed file.
68-
check-exported: false
69-
70-
nakedret:
71-
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
72-
max-func-lines: 30
73-
74-
prealloc:
75-
# XXX: we don't recommend using this linter before doing performance profiling.
76-
# For most programs usage of prealloc will be a premature optimization.
77-
78-
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
79-
# True by default.
80-
simple: true
81-
range-loops: true # Report preallocation suggestions on range loops, true by default
82-
for-loops: false # Report preallocation suggestions on for loops, false by default
83-
84-
gocritic:
85-
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
86-
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
87-
enabled-tags:
88-
- performance
89-
90-
settings: # settings passed to gocritic
91-
captLocal: # must be valid enabled check name
92-
paramsOnly: true
93-
rangeValCopy:
94-
sizeThreshold: 32
95-
8+
text:
9+
path: stdout
9610
linters:
9711
enable:
98-
- govet
99-
- gocyclo
100-
- gocritic
12+
- asasalint
13+
- asciicheck
14+
- bidichk
15+
- bodyclose
16+
- contextcheck
17+
- durationcheck
18+
- errchkjson
19+
- errorlint
20+
- exhaustive
21+
- gocheckcompilerdirectives
22+
- gochecksumtype
10123
- goconst
102-
- goimports
103-
- gofmt # We enable this as well as goimports for its simplify mode.
104-
- gosimple
24+
- gocritic
25+
- gocyclo
26+
- gosec
27+
- gosmopolitan
28+
- loggercheck
29+
- makezero
30+
- misspell
31+
- musttag
32+
- nakedret
33+
- nilerr
34+
- nilnesserr
35+
- noctx
10536
- prealloc
37+
- protogetter
38+
- reassign
39+
- recvcheck
10640
- revive
107-
- staticcheck
41+
- rowserrcheck
42+
- spancheck
43+
- sqlclosecheck
44+
- testifylint
10845
- unconvert
109-
- unused
110-
- misspell
111-
- nakedret
112-
113-
presets:
114-
- bugs
115-
- unused
116-
fast: false
117-
46+
- unparam
47+
- zerologlint
48+
settings:
49+
dupl:
50+
threshold: 100
51+
errcheck:
52+
check-type-assertions: false
53+
check-blank: false
54+
exclude-functions:
55+
- io/ioutil.ReadFile
56+
- io/ioutil.ReadDir
57+
- io/ioutil.ReadAll
58+
goconst:
59+
min-len: 3
60+
min-occurrences: 5
61+
gocritic:
62+
enabled-tags:
63+
- performance
64+
settings:
65+
captLocal:
66+
paramsOnly: true
67+
rangeValCopy:
68+
sizeThreshold: 32
69+
gocyclo:
70+
min-complexity: 15
71+
lll:
72+
tab-width: 1
73+
nakedret:
74+
max-func-lines: 30
75+
prealloc:
76+
simple: true
77+
range-loops: true
78+
for-loops: false
79+
revive:
80+
confidence: 0.8
81+
unparam:
82+
check-exported: false
83+
exclusions:
84+
generated: lax
85+
rules:
86+
- linters:
87+
- dupl
88+
- errcheck
89+
- gocyclo
90+
- gosec
91+
- scopelint
92+
- unparam
93+
path: _test(ing)?\.go
94+
- linters:
95+
- gocritic
96+
path: _test\.go
97+
text: (unnamedResult|exitAfterDefer)
98+
- linters:
99+
- gocritic
100+
text: '(hugeParam|rangeValCopy):'
101+
- linters:
102+
- staticcheck
103+
text: 'SA3000:'
104+
- linters:
105+
- gosec
106+
text: 'G101:'
107+
- linters:
108+
- gosec
109+
text: 'G104:'
110+
- linters:
111+
- staticcheck
112+
text: 'QF1008:'
113+
- linters:
114+
- staticcheck
115+
text: 'QF1001:'
116+
paths:
117+
- zz_\..+\.go$
118+
- third_party$
119+
- builtin$
120+
- examples$
118121
issues:
119-
exclude-files:
120-
- "zz_\\..+\\.go$"
121-
# Excluding configuration per-path and per-linter
122-
exclude-rules:
123-
# Exclude some linters from running on tests files.
124-
- path: _test(ing)?\.go
125-
linters:
126-
- gocyclo
127-
- errcheck
128-
- dupl
129-
- gosec
130-
- scopelint
131-
- unparam
132-
133-
# Ease some gocritic warnings on test files.
134-
- path: _test\.go
135-
text: "(unnamedResult|exitAfterDefer)"
136-
linters:
137-
- gocritic
138-
139-
# These are performance optimisations rather than style issues per se.
140-
# They warn when function arguments or range values copy a lot of memory
141-
# rather than using a pointer.
142-
- text: "(hugeParam|rangeValCopy):"
143-
linters:
144-
- gocritic
145-
146-
# This "TestMain should call os.Exit to set exit code" warning is not clever
147-
# enough to notice that we call a helper method that calls os.Exit.
148-
- text: "SA3000:"
149-
linters:
150-
- staticcheck
151-
152-
- text: "k8s.io/api/core/v1"
153-
linters:
154-
- goimports
155-
156-
# This is a "potential hardcoded credentials" warning. It's triggered by
157-
# any variable with 'secret' in the same, and thus hits a lot of false
158-
# positives in Kubernetes land where a Secret is an object type.
159-
- text: "G101:"
160-
linters:
161-
- gosec
162-
- gas
163-
164-
# This is an 'errors unhandled' warning that duplicates errcheck.
165-
- text: "G104:"
166-
linters:
167-
- gosec
168-
- gas
169-
170-
# Independently from option `exclude` we use default exclude patterns,
171-
# it can be disabled by this option. To list all
172-
# excluded by default patterns execute `golangci-lint run --help`.
173-
# Default value for this option is true.
174-
exclude-use-default: false
175-
176-
# Show only new issues: if there are unstaged changes or untracked files,
177-
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
178-
# It's a super-useful option for integration of golangci-lint into existing
179-
# large codebase. It's not practical to fix all existing issues at the moment
180-
# of integration: much better don't allow issues in new code.
181-
# Default is false.
182-
new: false
183-
184-
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
185122
max-issues-per-linter: 0
186-
187-
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
188123
max-same-issues: 0
124+
new: false
125+
formatters:
126+
enable:
127+
- gofmt
128+
- goimports
129+
settings:
130+
gofmt:
131+
simplify: true
132+
goimports:
133+
local-prefixes:
134+
- github.com/crossplane-contrib/provider-helm
135+
exclusions:
136+
generated: lax
137+
paths:
138+
- zz_\..+\.go$
139+
- third_party$
140+
- builtin$
141+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider
2626
GO_LDFLAGS += -X $(GO_PROJECT)/pkg/version.Version=$(VERSION)
2727
GO_SUBDIRS += cmd pkg apis
2828
GO111MODULE = on
29-
GOLANGCILINT_VERSION = 1.61.0
29+
GOLANGCILINT_VERSION = 2.1.2
3030

3131
-include build/makelib/golang.mk
3232

0 commit comments

Comments
 (0)