Skip to content

Commit e6f2372

Browse files
jlebondustymabe
authored andcommittedMay 11, 2023
cmd-init: run git submodule update when --commit is used
When building RHCOS, we first build for x86_64 on the latest commit available on the stream's branch. When we trigger builds for other arches, we want to make sure the same commit of the src config is used, so we pass `--commit`. However, `--commit` doesn't reset git submodule, so there's a race condition where if a submodule bump landed between the x86_64 build and the multi-arch builds, we would use the latest submodule, rather than the older one. Run `git submodule update` to fix this race.
1 parent 284f73a commit e6f2372

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎src/cmd-init

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ mkdir -p src
169169
if [ -n "${COMMIT}" ]; then
170170
git -C ./config fetch origin "$COMMIT"
171171
git -C ./config reset --hard "$COMMIT"
172+
git -C ./config submodule update --init --recursive
172173
fi
173174
(set +x; cd config && echo -n "Config commit: " && git describe --tags --always --abbrev=42)
174175
;;

0 commit comments

Comments
 (0)