Skip to content

Commit fe06e7e

Browse files
authored
Merge pull request #19 from cert-manager/self-upgrade
[CI] Merge self-upgrade into main
2 parents a0b035a + 8d1d3b4 commit fe06e7e

File tree

3 files changed

+37
-16
lines changed

3 files changed

+37
-16
lines changed

klone.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@ targets:
1010
- folder_name: boilerplate
1111
repo_url: https://github.com/cert-manager/makefile-modules.git
1212
repo_ref: main
13-
repo_hash: 2d17d1af47e0c904fb46ade54df9101751d19251
13+
repo_hash: 06bb8b339f2033e196cba881bc0fb724e1315cc5
1414
repo_path: modules/boilerplate
1515
- folder_name: generate-verify
1616
repo_url: https://github.com/cert-manager/makefile-modules.git
1717
repo_ref: main
18-
repo_hash: 2d17d1af47e0c904fb46ade54df9101751d19251
18+
repo_hash: 06bb8b339f2033e196cba881bc0fb724e1315cc5
1919
repo_path: modules/generate-verify
2020
- folder_name: help
2121
repo_url: https://github.com/cert-manager/makefile-modules.git
2222
repo_ref: main
23-
repo_hash: 2d17d1af47e0c904fb46ade54df9101751d19251
23+
repo_hash: 06bb8b339f2033e196cba881bc0fb724e1315cc5
2424
repo_path: modules/help
2525
- folder_name: klone
2626
repo_url: https://github.com/cert-manager/makefile-modules.git
2727
repo_ref: main
28-
repo_hash: 2d17d1af47e0c904fb46ade54df9101751d19251
28+
repo_hash: 06bb8b339f2033e196cba881bc0fb724e1315cc5
2929
repo_path: modules/klone
3030
- folder_name: oci-image
3131
repo_url: https://github.com/cert-manager/makefile-modules.git
3232
repo_ref: main
33-
repo_hash: 2d17d1af47e0c904fb46ade54df9101751d19251
33+
repo_hash: 06bb8b339f2033e196cba881bc0fb724e1315cc5
3434
repo_path: modules/oci-image
3535
- folder_name: repository-base
3636
repo_url: https://github.com/cert-manager/makefile-modules.git
3737
repo_ref: main
38-
repo_hash: 2d17d1af47e0c904fb46ade54df9101751d19251
38+
repo_hash: 06bb8b339f2033e196cba881bc0fb724e1315cc5
3939
repo_path: modules/repository-base
4040
- folder_name: tools
4141
repo_url: https://github.com/cert-manager/makefile-modules.git
4242
repo_ref: main
43-
repo_hash: 2d17d1af47e0c904fb46ade54df9101751d19251
43+
repo_hash: 06bb8b339f2033e196cba881bc0fb724e1315cc5
4444
repo_path: modules/tools

make/_shared/oci-image/01_mod.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ $(oci_build_targets): oci-build-%: | $(NEEDS_KO) $(NEEDS_GO) $(NEEDS_YQ) $(bin_d
8484
$(YQ) '.builds[0].ldflags[2] = "{{.Env.LDFLAGS}}"' \
8585
> $(CURDIR)/$(oci_layout_path).ko_config.yaml
8686

87+
KO_DOCKER_REPO=$(oci_$*_image_name_development) \
8788
KOCACHE=$(bin_dir)/scratch/image/ko_cache \
8889
KO_CONFIG_PATH=$(CURDIR)/$(oci_layout_path).ko_config.yaml \
8990
SOURCE_DATE_EPOCH=$(GITEPOCH) \
@@ -93,11 +94,11 @@ $(oci_build_targets): oci-build-%: | $(NEEDS_KO) $(NEEDS_GO) $(NEEDS_YQ) $(bin_d
9394
GOEXPERIMENT=$(GOEXPERIMENT) \
9495
$(KO) build $(go_$*_source_path) \
9596
--platform=$(oci_platforms) \
96-
--oci-layout-path=$(CURDIR)/$(oci_layout_path) \
97+
--oci-layout-path=$(oci_layout_path) \
9798
--sbom-dir=$(CURDIR)/$(oci_layout_path).sbom \
9899
--sbom=spdx \
99100
--push=false \
100-
--base-import-paths
101+
--bare
101102

102103
cd $(image_tool_dir) && $(GO) run . list-digests \
103104
$(CURDIR)/$(oci_layout_path) \

make/_shared/tools/util/checkhash.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,36 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
2121
# This script takes the hash of its first argument and verifies it against the
2222
# hex hash given in its second argument
2323

24-
SHASUM=$("${SCRIPT_DIR}/hash.sh" "$1")
24+
function usage_and_exit() {
25+
echo "usage: $0 <path-to-target> <expected-hash>"
26+
echo "or: LEARN_FILE=<path-to-learn-file> $0 <path-to-target> <old-hash>"
27+
exit 1
28+
}
29+
30+
HASH_TARGET=${1:-}
31+
EXPECTED_HASH=${2:-}
32+
33+
if [[ -z $HASH_TARGET ]]; then
34+
usage_and_exit
35+
fi
36+
37+
if [[ -z $EXPECTED_HASH ]]; then
38+
usage_and_exit
39+
fi
40+
41+
SHASUM=$("${SCRIPT_DIR}/hash.sh" "$HASH_TARGET")
42+
43+
if [[ "$SHASUM" == "$EXPECTED_HASH" ]]; then
44+
exit 0
45+
fi
2546

2647
# When running 'make learn-sha-tools', we don't want this script to fail.
2748
# Instead we log what sha values are wrong, so the make.mk file can be updated.
28-
if [ "$SHASUM" != "$2" ] && [ "${LEARN_FILE:-}" != "" ]; then
29-
echo "s/$2/$SHASUM/g" >> "${LEARN_FILE:-}"
49+
50+
if [ "${LEARN_FILE:-}" != "" ]; then
51+
echo "s/$EXPECTED_HASH/$SHASUM/g" >> "${LEARN_FILE:-}"
3052
exit 0
3153
fi
3254

33-
if [ "$SHASUM" != "$2" ]; then
34-
echo "invalid checksum for \"$1\": wanted \"$2\" but got \"$SHASUM\""
35-
exit 1
36-
fi
55+
echo "invalid checksum for \"$HASH_TARGET\": wanted \"$EXPECTED_HASH\" but got \"$SHASUM\""
56+
exit 1

0 commit comments

Comments
 (0)