Skip to content

Commit 630f88d

Browse files
Roming22Bharath Nallapeta
authored andcommitted
Add mechanism to freeze a dependency version
The change also fixes a bug that was forcing the HyperShift version to be set with the hadolint version. Signed-off-by: Romain Arnaud <[email protected]>
1 parent ff91326 commit 630f88d

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

developer/images/dependencies-update/hack/bin/tasks/update_binaries.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ run_task() {
2929
DEPENDENCIES="$WORKSPACE_DIR/shared/config/dependencies.sh"
3030
echo "Update binaries" >"$COMMIT_MSG"
3131
mapfile -t BINARIES < <(
32-
grep --extended-regexp "[A-Z]*_VERSION=" "$DEPENDENCIES" \
32+
grep --extended-regexp "^ *[^#]* *[A-Z]*_VERSION=" "$DEPENDENCIES" \
3333
| sed "s:export *\(.*\)_VERSION=.*:\1:" \
3434
| tr "[:upper:]" "[:lower:]" \
3535
| sort
@@ -45,7 +45,12 @@ run_task() {
4545
}
4646

4747
update_binary() {
48+
if grep --ignore-case --quiet " ${BINARY}_VERSION=.*# *Freeze" "$DEPENDENCIES"; then
49+
# Ignore frozen dependencies
50+
return
51+
fi
4852
echo "$BINARY"
53+
unset VERSION
4954
"get_${BINARY}_version"
5055
BINARY=$(echo "$BINARY" | tr "[:lower:]" "[:upper:]")
5156
sed -i -e "s:\( ${BINARY}_VERSION\)=.*:\1=\"$VERSION\":" "$DEPENDENCIES"
@@ -77,12 +82,8 @@ get_hadolint_version() {
7782
}
7883

7984
get_hypershift_version() {
80-
# shellcheck source=shared/config/dependencies.sh
81-
source "$DEPENDENCIES"
82-
if [ "$HYPERSHIFT_VERSION" != "main" ]; then
83-
echo "Not implemented"
84-
exit 1
85-
fi
85+
echo "[ERROR] Not implemented: get_hypershift_version"
86+
exit 1
8687
}
8788

8889
get_jq_version() {

shared/config/dependencies.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#!/usr/bin/env bash
2+
# To prevent a version to be upgraded by 'update_binaries.sh',
3+
# add '# Freeze' after the export.
4+
# E.g.:
5+
# export FOOBAR_VERSION="1.2.3" # Freeze
26
export ARGOCD_VERSION="v2.5.7"
37
export BITWARDEN_VERSION="v2023.1.0"
48
export CHECKOV_VERSION="2.2.281"
59
export GO_VERSION="1.19.5"
610
export HADOLINT_VERSION="v2.12.0"
7-
export HYPERSHIFT_VERSION="main"
11+
export HYPERSHIFT_VERSION="main" # Freeze
812
export JQ_VERSION="1.6"
913
export KIND_VERSION="v0.17.0"
1014
export KUBECTL_VERSION="v1.26.1"

0 commit comments

Comments
 (0)