Skip to content

Commit 61e7ac2

Browse files
authored
Merge pull request #17244 from justinsb/update_dependencies
chore: create script to update dependencies
2 parents c247ef0 + 0a88783 commit 61e7ac2

File tree

2 files changed

+51
-10
lines changed

2 files changed

+51
-10
lines changed

Makefile

-10
Original file line numberDiff line numberDiff line change
@@ -328,16 +328,6 @@ gomod:
328328
cd tests/e2e; go mod tidy
329329
cd tools/otel/traceserver; go mod tidy
330330

331-
.PHONY: goget
332-
goget:
333-
go get $(shell go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -mod=mod -m all | grep -v spotinst-sdk-go)
334-
cd hack; go get $(shell go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -mod=mod -m all)
335-
cd tests/e2e; go get $(shell go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -mod=mod -m all | grep -v kubetest2)
336-
cd tools/otel/traceserver; go get $(shell go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -mod=mod -m all)
337-
338-
.PHONY: depup
339-
depup: goget gomod
340-
341331
.PHONY: gofmt
342332
gofmt:
343333
find $(KOPS_ROOT) -name "*.go" | grep -v vendor | xargs gofmt -w -s

dev/codebots/update-dependencies

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# Copyright 2025 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
# start at the root of the repo
22+
REPO_ROOT="$(git rev-parse --show-toplevel)"
23+
cd "${REPO_ROOT}"
24+
25+
# Go through all our modules and update them to the latest version
26+
# We exclude a few dependencies
27+
# IDEA: Can we create a tool that will make this easier? Make like a .upgrade-deps.yaml or .codebots.yaml file in each module?
28+
29+
cd "${REPO_ROOT}"
30+
go get $(go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -mod=mod -m all | grep -v spotinst-sdk-go)
31+
32+
cd "${REPO_ROOT}/hack"
33+
go get $(go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -mod=mod -m all)
34+
35+
cd "${REPO_ROOT}/tests/e2e"
36+
go get $(go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -mod=mod -m all | grep -v kubetest2)
37+
38+
cd "${REPO_ROOT}/tools/otel/traceserver"
39+
go get $(go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -mod=mod -m all)
40+
41+
# Tidy go modules
42+
cd "${REPO_ROOT}"
43+
make gomod
44+
45+
if $(git diff --quiet); then
46+
echo "No changes"
47+
else
48+
git add .
49+
git commit -m "codebot: update-dependencies"
50+
echo "Updated dependencies"
51+
fi

0 commit comments

Comments
 (0)