Skip to content

Commit

Permalink
openshift installer download using oc
Browse files Browse the repository at this point in the history
Signed-off-by: vavuthu <[email protected]>
  • Loading branch information
vavuthu committed Jun 27, 2024
1 parent 176cd0a commit c04c0e5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ocs_ci/utility/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c04c0e5

Please sign in to comment.