Skip to content

Commit 7ce69e6

Browse files
committed
[CI] check-params-env.sh prints also time of creation of the checked image
1 parent 7983f1a commit 7ce69e6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

ci/check-params-env.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ function check_image() {
248248
local image_name
249249
local image_commit_id
250250
local image_commitref
251+
local image_created
251252

252253
image_metadata="$(skopeo inspect --config "docker://${image_url}")" || {
253254
echo "Couldn't download image metadata with skopeo tool!"
@@ -265,6 +266,10 @@ function check_image() {
265266
echo "Couldn't parse '.config.Labels."io.openshift.build.commit.ref"' from image metadata!"
266267
return 1
267268
}
269+
image_created=$(echo "${image_metadata}" | jq --raw-output '.created') || {
270+
echo "Couldn't parse '.created' from image metadata!"
271+
return 1
272+
}
268273

269274
local config_env
270275
local build_name_raw
@@ -289,6 +294,7 @@ function check_image() {
289294
}
290295

291296
echo "Image name retrieved: '${image_name}'"
297+
echo "Image created: '${image_created}'"
292298

293299
check_image_variable_matches_name_and_commitref "${image_variable}" "${image_name}" "${image_commitref}" "${openshift_build_name}" || return 1
294300

ci/check-runtime-images.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function check_image() {
2727
local img_tag
2828
local img_url
2929
local img_metadata
30+
local img_created
3031

3132
img_tag=$(jq -r '.metadata.tags[0]' "${runtime_image_file}") || {
3233
echo "ERROR: Couldn't parse image tags metadata for '${runtime_image_file}' runtime image file!"
@@ -42,13 +43,20 @@ function check_image() {
4243
return 1
4344
}
4445

46+
img_created=$(echo "${img_metadata}" | jq --raw-output '.created') || {
47+
echo "Couldn't parse '.created' from image metadata!"
48+
return 1
49+
}
50+
4551
local expected_string="runtime-${img_tag}-ubi"
4652
echo "Checking that '${expected_string}' is present in the image metadata"
4753
echo "${img_metadata}" | grep --quiet "${expected_string}" || {
4854
echo "ERROR: The string '${expected_string}' isn't present in the image metadata at all. Please check that the referenced image '${img_url}' is the correct one!"
4955
return 1
5056
}
5157

58+
echo "Image created: '${img_created}'"
59+
5260
# TODO: we shall extend this check to check also Label "io.openshift.build.commit.ref" value (e.g. '2024a') or something similar
5361
}
5462

0 commit comments

Comments
 (0)