From 4cdcca52e63710557f74e62d4430fcaf11d2a2c7 Mon Sep 17 00:00:00 2001 From: Larry Singh Date: Wed, 29 May 2024 14:25:13 -0700 Subject: [PATCH 1/2] [EN-184] Created tw-post-install script to set our future helm repo as the only one that is present in rancher by default --- tw-post-install/script.sh | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tw-post-install/script.sh diff --git a/tw-post-install/script.sh b/tw-post-install/script.sh new file mode 100644 index 00000000000..7e872decd32 --- /dev/null +++ b/tw-post-install/script.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# TODO: Uncomment these for SUSE Linux +# sudo zypper refresh +# sudo zypper install jq + +# Check if required arguments are provided +if [ "$#" -ne 3 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Assign arguments to variables +ADMIN_USERNAME="$1" +ADMIN_PASSWORD="$2" +BASE_URL="$3" +# TODO: Replace this URL with our helm chart repo +TENSORWAVE_HELM_REPO_URL="https://charts.bitnami.com/bitnami" + +LOGIN_RESPONSE=$(curl -k --location "$BASE_URL/v3-public/localProviders/local?action=login" \ +--header "Content-Type: application/json" \ +--data "{\"username\":\"$ADMIN_USERNAME\", \"password\":\"$ADMIN_PASSWORD\"}") + +token=$(echo "$LOGIN_RESPONSE" | jq -r '.token') + +curl -k --location "$BASE_URL/v1/catalog.cattle.io.clusterrepos" \ +--header "Content-Type: application/json" \ +--header "Authorization: Bearer $token" \ +--data '{ + "type": "catalog.cattle.io.clusterrepo", + "metadata": { + "name": "tensorwave" + }, + "spec": { + "url": "'"$TENSORWAVE_HELM_REPO_URL"'", + "clientSecret": null + } +}' + +curl -k --location --request DELETE "$BASE_URL/v1/catalog.cattle.io.clusterrepos/rancher-partner-charts" \ +--header 'Content-Type: application/json' \ +--header "Authorization: Bearer $token" + +curl -k --location --request DELETE "$BASE_URL/v1/catalog.cattle.io.clusterrepos/rancher-charts" \ +--header 'Content-Type: application/json' \ +--header "Authorization: Bearer $token" + +curl -k --location --request DELETE "$BASE_URL/v1/catalog.cattle.io.clusterrepos/rancher-rke2-charts" \ +--header 'Content-Type: application/json' \ +--header "Authorization: Bearer $token" \ No newline at end of file From dfaf182724df9f18dac4620154c7500ad0cfec9d Mon Sep 17 00:00:00 2001 From: Larry Singh Date: Thu, 30 May 2024 11:09:30 -0700 Subject: [PATCH 2/2] [EN-184] Change private label --- shell/config/private-label.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/config/private-label.js b/shell/config/private-label.js index 1a2f65816d9..2545ec5d997 100644 --- a/shell/config/private-label.js +++ b/shell/config/private-label.js @@ -66,7 +66,7 @@ export function getVendor() { return STANDARD_VENDOR; } - return vendor; + return 'TensorWave'; } export function getProduct() {