Skip to content

Commit 8073792

Browse files
authored
build: Upgrade tools (#24
Also fix upgrade go tools recipe.
1 parent 254392f commit 8073792

File tree

5 files changed

+28
-19
lines changed

5 files changed

+28
-19
lines changed

.go-tools

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
github.com/oligot/[email protected]
22
github.com/segmentio/[email protected]
33
gotest.tools/[email protected]
4-
sigs.k8s.io/controller-runtime/tools/[email protected]20230131195449-5db173878d6d
5-
github.com/google/go-containerregistry/cmd/crane@v0.12.1
6-
github.com/drone/envsubst/cmd/[email protected] # FREEZE
4+
sigs.k8s.io/controller-runtime/tools/[email protected]20230208013708-22718275bffe
5+
github.com/google/go-containerregistry/cmd/crane@v0.13.0
6+
github.com/drone/envsubst/cmd/[email protected]

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ repos:
9797
- --comment-style
9898
- <!--|| -->
9999
- repo: https://github.com/norwoodj/helm-docs
100-
rev: v1.2.0
100+
rev: v1.11.0
101101
hooks:
102102
- id: helm-docs
103103
stages: [commit]

.tool-versions

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
clusterctl 1.3.3
22
flux2 0.39.0
3-
gcloud 416.0.0
4-
gcloud 416.0.0
3+
gcloud 417.0.1
54
ginkgo 2.8.0
65
gojq 0.12.11
76
golang 1.20
8-
golangci-lint 1.51.0
9-
goreleaser 1.15.0
10-
helm 3.11.0
7+
golangci-lint 1.51.1
8+
goreleaser 1.15.2
9+
helm 3.11.1
1110
helm-docs 1.11.0
1211
kind 0.17.0
13-
kube-controller-tools 0.11.2
12+
kube-controller-tools 0.11.3
1413
kubectl 1.26.1
15-
kustomize 4.5.7
16-
pre-commit 3.0.2
14+
kustomize 5.0.0
15+
pre-commit 3.0.4
1716
shfmt 3.6.0
1817
upx 4.0.2

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Copyright 2023 D2iQ, Inc. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
FROM --platform=linux/amd64 gcr.io/distroless/static@sha256:93bb1b564033909a660111671303f9683e13f0567de95e4b6fde3226e532955e as linux-amd64
7-
FROM --platform=linux/arm64 gcr.io/distroless/static@sha256:72fec9960c247e7e68ed1db4b5b561f6b6da437215fb41d5fd7df790ec6df1a7 as linux-arm64
6+
FROM --platform=linux/amd64 gcr.io/distroless/static@sha256:b1a9ecc1b37ec3bc9a2d8f8a0a5090ee5babda422f2b1c3724f108fa7e506e77 as linux-amd64
7+
FROM --platform=linux/arm64 gcr.io/distroless/static@sha256:2fc464bd828a7f713020c06f0bb4ff01670d08292ba4a01ffbc3b56a1d59da3a as linux-arm64
88

99
FROM --platform=linux/${TARGETARCH} linux-${TARGETARCH}
1010

make/tools.mk

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,18 @@ upgrade-tools: upgrade-go-tools; $(info $(M) upgrading all tools to latest avail
8080
upgrade-go-tools: ## Upgrades all go tools to latest available versions
8181
upgrade-go-tools: install-tool.golang; $(info $(M) upgrading all go tools to latest available versions)
8282
grep -v '# FREEZE' .go-tools | \
83-
grep -Eo '^[^#]\S+' | \
84-
sed 's/@.\+$$/@latest/' | \
85-
xargs -I {} bash -ec '\
86-
export LATEST_VERSION=$$(go list -m {}) && \
87-
sed -i "s|$${LATEST_VERSION%% *}@.\+$$|$${LATEST_VERSION/ /@}|" .go-tools'
83+
grep -Eo '^[^#][^@]+' | \
84+
xargs -I {} bash -ec ' \
85+
original_module_path={}; \
86+
module_path={}; \
87+
while [ "$${module_path}" != "." ]; do \
88+
LATEST_VERSION=$$(go list -m $${module_path}@latest 2>/dev/null || echo ""); \
89+
if [ -n "$${LATEST_VERSION}" ]; then \
90+
sed -i "s|$${original_module_path}@.\+$$|$${original_module_path}@$${LATEST_VERSION#* }|" .go-tools; \
91+
exit; \
92+
else \
93+
module_path=$$(dirname $${module_path}); \
94+
fi; \
95+
done; \
96+
echo "Failed to find latest module version for $${original_module_path}"; \
97+
exit 1'

0 commit comments

Comments
 (0)