From 0176ca6d78e6bb771cab14b76f92277fdb030908 Mon Sep 17 00:00:00 2001 From: kishorekumar-anchala <168699259+kishorekumar-anchala@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:26:57 +0530 Subject: [PATCH] fix openshift cli issue (#10153) --- images/ubuntu/scripts/build/install-oc-cli.sh | 14 ++++++++++++-- images/ubuntu/toolsets/toolset-2004.json | 6 +++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/images/ubuntu/scripts/build/install-oc-cli.sh b/images/ubuntu/scripts/build/install-oc-cli.sh index 8f8a06de4..a20f4275c 100644 --- a/images/ubuntu/scripts/build/install-oc-cli.sh +++ b/images/ubuntu/scripts/build/install-oc-cli.sh @@ -5,10 +5,20 @@ ################################################################################ # Source the helpers for use with the script +source $HELPER_SCRIPTS/os.sh source $HELPER_SCRIPTS/install.sh -# Install the oc CLI -archive_path=$(download_with_retry "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz") +if is_ubuntu20; then + toolset_version=$(get_toolset_value '.ocCli.version') + download_url="https://mirror.openshift.com/pub/openshift-v4/clients/ocp/$toolset_version/openshift-client-linux-$toolset_version.tar.gz" +else + + # Install the oc CLI + download_url="https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz" +fi + +archive_path=$(download_with_retry "$download_url") + tar xzf "$archive_path" -C "/usr/local/bin" oc invoke_tests "CLI.Tools" "OC CLI" diff --git a/images/ubuntu/toolsets/toolset-2004.json b/images/ubuntu/toolsets/toolset-2004.json index 947d673b8..221de2935 100644 --- a/images/ubuntu/toolsets/toolset-2004.json +++ b/images/ubuntu/toolsets/toolset-2004.json @@ -378,5 +378,9 @@ "aliyunCli": { "version": "3.0.174", "sha256": "0c51028a7a32fc02c8de855f73e273556f957115eb5624565738f9b9f83a50ba" - } + }, + "ocCli": { + "version": "4.15.19" + } + }