Skip to content

Commit

Permalink
extract the pull-secret and place it under /data dir (red-hat-storage…
Browse files Browse the repository at this point in the history
…#8110)

Signed-off-by: Mahesh Shetty <[email protected]>
  • Loading branch information
mashetty330 authored Aug 1, 2023
1 parent 778db41 commit 2711104
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ocs_ci/ocs/resources/mcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,18 @@ def retrieve_noobaa_cli_binary(self):
image = f"registry.redhat.io/odf4/mcg-cli-rhel9:v{semantic_version}"
else:
image = f"quay.io/rhceph-dev/mcg-cli:{get_ocs_build_number()}"

pull_secret_path = os.path.join(constants.DATA_DIR, "pull-secret")

if not os.path.isfile(pull_secret_path):
logger.info(
f"Extracting pull-secret and placing it under {pull_secret_path}"
)
exec_cmd(
f"oc get secret pull-secret -n {constants.OPENSHIFT_CONFIG_NAMESPACE} -ojson | "
f"jq -r '.data.\".dockerconfigjson\"|@base64d' > {pull_secret_path}",
shell=True,
)
exec_cmd(
f"oc image extract --registry-config {pull_secret_path} "
f"{image} --confirm "
Expand Down

0 comments on commit 2711104

Please sign in to comment.