From c04c0e5a1d7d0a5521336139fc9999419b4324e6 Mon Sep 17 00:00:00 2001 From: vavuthu Date: Thu, 27 Jun 2024 10:52:48 +0530 Subject: [PATCH] openshift installer download using oc Signed-off-by: vavuthu --- ocs_ci/utility/utils.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ocs_ci/utility/utils.py b/ocs_ci/utility/utils.py index c921e8d93cc..4e688d4343c 100644 --- a/ocs_ci/utility/utils.py +++ b/ocs_ci/utility/utils.py @@ -790,11 +790,12 @@ def get_openshift_installer( # record current working directory and switch to BIN_DIR previous_dir = os.getcwd() os.chdir(bin_dir) - tarball = f"{installer_filename}.tar.gz" - url = get_openshift_mirror_url(installer_filename, version) - download_file(url, tarball) - run_cmd(f"tar xzvf {tarball} {installer_filename}") - delete_file(tarball) + pull_secret_path = os.path.join(constants.DATA_DIR, "pull-secret") + cmd = ( + f"oc adm release extract --registry-config {pull_secret_path} --command={installer_filename} " + f"--to ./ registry.ci.openshift.org/ocp/release:{version}" + ) + exec_cmd(cmd) # return to the previous working directory os.chdir(previous_dir)