File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -131,9 +131,20 @@ build_with_buildah() {
131131 fi
132132 fi
133133
134+ # Here we call prepare_git_artifacts just for its git logic, We don't
135+ # actually care about the JSON file; the source of truth is in the labels.
136+ prepare_git_artifacts src/config " ${tempdir} /coreos-assembler-config-git.json"
137+ source=$( jq -r .git.origin " ${tempdir} /coreos-assembler-config-git.json" )
138+ commit=$( jq -r .git.commit " ${tempdir} /coreos-assembler-config-git.json" )
139+ rm -f " ${tempdir} /coreos-assembler-config-git.json"
140+
141+ # For the source: check if there's only one remote, if so use it with get-url
142+ # For revision: rev-parse
134143 set -- build --security-opt=label=disable --cap-add=all --device /dev/fuse \
135144 --build-arg-file " $argsfile " -v " $( realpath " ${tempdir} /src" ) " :/run/src \
136- --build-arg VERSION=" ${VERSION} "
145+ --build-arg VERSION=" ${VERSION} " \
146+ --label org.opencontainers.image.source=" ${source} " \
147+ --label org.opencontainers.image.revision=" ${commit} "
137148
138149 # XXX: Temporary hack until we have https://github.com/coreos/rpm-ostree/pull/5454
139150 # which would allow us to fold this back into the build process.
You can’t perform that action at this time.
0 commit comments