Skip to content

Commit 5f18966

Browse files
authored
Merge pull request #1486 from Nordix/lentzi90/backport-security-fixes-release-0.7
🐛 [release-0.7] uplift go and x/net
2 parents 27a0293 + f4593b2 commit 5f18966

File tree

12 files changed

+475
-920
lines changed

12 files changed

+475
-920
lines changed

Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# media type: "application/vnd.oci.image.layer.v1.tar+gzip"
2525

2626
# Build the manager binary
27-
FROM golang:1.19.3 as builder
27+
FROM golang:1.19.6 as builder
2828
WORKDIR /workspace
2929

3030
# Run this with docker build --build_arg goproxy=$(go env GOPROXY) to override the goproxy

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 manager binary
18-
FROM golang:1.19.3 as builder
18+
FROM golang:1.19.6 as builder
1919
WORKDIR /workspace
2020

2121
# Run this with docker build --build_arg goproxy=$(go env GOPROXY) to override the goproxy

api/v1alpha6/openstackmachinetemplate_webhook_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ func TestOpenStackMachineTemplate_ValidateUpdate(t *testing.T) {
150150
}
151151

152152
for _, tt := range tests {
153+
tt := tt
153154
t.Run(tt.name, func(t *testing.T) {
154155
t.Parallel()
155156

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/prometheus/client_golang v1.13.0
1717
github.com/spf13/pflag v1.0.5
1818
golang.org/x/crypto v0.3.0
19-
golang.org/x/text v0.5.0
19+
golang.org/x/text v0.7.0
2020
gopkg.in/ini.v1 v1.67.0
2121
k8s.io/api v0.25.0
2222
k8s.io/apiextensions-apiserver v0.25.0
@@ -108,10 +108,10 @@ require (
108108
go.uber.org/atomic v1.7.0 // indirect
109109
go.uber.org/multierr v1.6.0 // indirect
110110
go.uber.org/zap v1.21.0 // indirect
111-
golang.org/x/net v0.4.0 // indirect
111+
golang.org/x/net v0.7.0 // indirect
112112
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
113-
golang.org/x/sys v0.3.0 // indirect
114-
golang.org/x/term v0.3.0 // indirect
113+
golang.org/x/sys v0.5.0 // indirect
114+
golang.org/x/term v0.5.0 // indirect
115115
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
116116
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
117117
google.golang.org/appengine v1.6.7 // indirect

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su
625625
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
626626
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
627627
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
628-
golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=
629-
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
628+
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
629+
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
630630
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
631631
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
632632
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -709,13 +709,13 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
709709
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
710710
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
711711
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
712-
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
713-
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
712+
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
713+
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
714714
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
715715
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
716716
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
717-
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
718-
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
717+
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
718+
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
719719
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
720720
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
721721
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -726,8 +726,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
726726
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
727727
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
728728
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
729-
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
730-
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
729+
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
730+
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
731731
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
732732
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
733733
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

hack/boilerplate/boilerplate.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,20 @@ def file_passes(filename, refs, regexs):
149149
def file_extension(filename):
150150
return os.path.splitext(filename)[1].split(".")[-1].lower()
151151

152-
skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh',
153-
"vendor", "test/e2e/generated/bindata.go", "hack/boilerplate/test",
154-
"pkg/kubectl/generated/bindata.go"]
152+
skipped_paths = [
153+
'_output',
154+
'.git',
155+
# Downloaded, not our copyright
156+
'hack/tools/ensure-golangci-lint.sh',
157+
]
155158

156159
# list all the files contain 'DO NOT EDIT', but are not generated
157-
skipped_ungenerated_files = ['hack/lib/swagger.sh', 'hack/boilerplate/boilerplate.py']
160+
skipped_ungenerated_files = ['hack/boilerplate/boilerplate.py']
158161

159162
def normalize_files(files):
160163
newfiles = []
161164
for pathname in files:
162-
if any(x in pathname for x in skipped_dirs):
165+
if any(x in pathname for x in skipped_paths):
163166
continue
164167
newfiles.append(pathname)
165168
for i, pathname in enumerate(newfiles):
@@ -173,12 +176,12 @@ def get_files(extensions):
173176
files = args.filenames
174177
else:
175178
for root, dirs, walkfiles in os.walk(args.rootdir):
176-
# don't visit certain dirs. This is just a performance improvement
179+
# don't visit certain paths. This is just a performance improvement
177180
# as we would prune these later in normalize_files(). But doing it
178181
# cuts down the amount of filesystem walking we do and cuts down
179182
# the size of the file list
180-
for d in skipped_dirs:
181-
if d in dirs:
183+
for p in skipped_paths:
184+
if p in dirs:
182185
dirs.remove(d)
183186

184187
for name in walkfiles:

hack/tools/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
ROOT_DIR_RELATIVE := ../..
1616
include $(ROOT_DIR_RELATIVE)/common.mk
1717

18+
GOLANGCI_LINT_VERSION := v1.51.1
19+
1820
UNAME := $(shell uname -s)
1921

2022
# Directories.
@@ -98,8 +100,8 @@ $(GOJQ): $(BIN_DIR) go.mod go.sum
98100
go build -tags=tools -o $@ github.com/itchyny/gojq/cmd/gojq
99101

100102
GOLANGCI_LINT := $(BIN_DIR)/golangci-lint
101-
$(GOLANGCI_LINT): $(BIN_DIR) go.mod go.sum # Build golangci-lint from tools folder.
102-
go build -tags=tools -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint
103+
$(GOLANGCI_LINT): Makefile ensure-golangci-lint.sh | $(BIN_DIR)
104+
./ensure-golangci-lint.sh -b $(BIN_DIR) $(GOLANGCI_LINT_VERSION)
103105

104106
KUSTOMIZE := $(BIN_DIR)/kustomize
105107
$(KUSTOMIZE): $(BIN_DIR) go.mod go.sum # Build kustomize from tools folder.

0 commit comments

Comments
 (0)