Skip to content

Commit f9503e8

Browse files
committed
build: get src commit from org.opencontainers.image.revision
Now that we have konflux-ci/build-definitions#2770 let's use the official OCI annotation.
1 parent 0fe10a3 commit f9503e8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

jobs/build.Jenkinsfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,7 @@ lock(resource: "build-${params.STREAM}") {
187187
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
188188
def src_config_commit = ""
189189
if (import_oci) {
190-
// TODO: use standard label 'org.opencontainers.image.revision' once available instead of 'vcs-ref' one
191-
// c.f https://github.com/konflux-ci/build-definitions/pull/2770
192-
src_config_commit = shwrapCapture("skopeo inspect -n --retry-times 3 docker://$import_oci_image | jq -r '.Labels.\"vcs-ref\"'")
190+
src_config_commit = shwrapCapture("skopeo inspect -n --retry-times 3 docker://$import_oci_image | jq -r '.Labels.\"org.opencontainers.image.revision\"'")
193191
} else {
194192
src_config_commit = shwrapCapture("git ls-remote ${url} refs/heads/${ref} | cut -d \$'\t' -f 1")
195193
}

0 commit comments

Comments
 (0)