Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
test: add auth to inspect private container image registry
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaofeng Wang <[email protected]>
  • Loading branch information
henrywang committed Apr 19, 2024
1 parent 36a7c40 commit e084724
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions anaconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -exuo pipefail

source tools/shared_lib.sh
dump_runner
image_inspect

greenprint "Start firewalld"
sudo systemctl enable --now firewalld
Expand Down
1 change: 1 addition & 0 deletions bib-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -exuo pipefail

source tools/shared_lib.sh
dump_runner
image_inspect

TEMPDIR=$(mktemp -d)
trap 'rm -rf -- "$TEMPDIR"' EXIT
Expand Down
1 change: 1 addition & 0 deletions os-replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -exuo pipefail

source tools/shared_lib.sh
dump_runner
image_inspect

TEMPDIR=$(mktemp -d)
trap 'rm -rf -- "$TEMPDIR"' EXIT
Expand Down
17 changes: 12 additions & 5 deletions tools/shared_lib.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/bin/bash

# shellcheck disable=SC2034
REDHAT_ID=$(skopeo inspect --tls-verify=false "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.id"')
REDHAT_VERSION_ID=$(skopeo inspect --tls-verify=false "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.version-id"')
CURRENT_COMPOSE_ID=$(skopeo inspect --tls-verify=false "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.compose-id"')

# Dumps details about the instance running the CI job.
function dump_runner {
RUNNER_CPUS=$(nproc)
Expand Down Expand Up @@ -51,3 +46,15 @@ function retry {
done
}

function image_inspect {
# shellcheck disable=SC2034
if [[ $TIER1_IMAGE_URL == quay* ]]; then
REDHAT_ID=$(skopeo inspect --tls-verify=false --creds "$QUAY_USERNAME":"$QUAY_PASSWORD" docker://"${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.id"')
REDHAT_VERSION_ID=$(skopeo inspect --tls-verify=false --creds "$QUAY_USERNAME":"$QUAY_PASSWORD" "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.version-id"')
CURRENT_COMPOSE_ID=$(skopeo inspect --tls-verify=false --creds "$QUAY_USERNAME":"$QUAY_PASSWORD" "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.compose-id"')
else
REDHAT_ID=$(skopeo inspect --tls-verify=false "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.id"')
REDHAT_VERSION_ID=$(skopeo inspect --tls-verify=false "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.version-id"')
CURRENT_COMPOSE_ID=$(skopeo inspect --tls-verify=false "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.compose-id"')
fi
}

0 comments on commit e084724

Please sign in to comment.