From 7178f81e4ac0894b8c245fd9967b1cd425eb1390 Mon Sep 17 00:00:00 2001 From: Yuvraj Vansure Date: Fri, 14 Jun 2024 21:29:24 +0530 Subject: [PATCH] [patch] code refactored --- image/cli/mascli/functions/install | 6 +++--- image/cli/mascli/functions/update | 6 ++---- image/cli/mascli/templates/pipelinerun-install.yaml | 3 ++- image/cli/mascli/templates/pipelinerun-update.yaml | 2 ++ tekton/src/pipelines/update.yml.j2 | 1 - 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/image/cli/mascli/functions/install b/image/cli/mascli/functions/install index 28c0b180fe..231bf84d0a 100644 --- a/image/cli/mascli/functions/install +++ b/image/cli/mascli/functions/install @@ -339,7 +339,7 @@ function install_noninteractive() { export UDS_CONTACT_LASTNAME=$1 && shift ;; # DRO - -dro-namespace) + --dro-namespace) export DRO_NAMESPACE=$1 && shift ;; @@ -780,8 +780,8 @@ function install() { uds_action_selection # Select DRO Namespace - if [[ "$INTERACTIVE_MODE" == "true" ]] &&[ [ "$UDS_ACTION" == "install-dro" ]]; then - prompt_for_input "Provide DRO Namespace [Default:'redhat-marketplace']" DRO_NAMESPACE + if [[ "$INTERACTIVE_MODE" == "true" ]] && [[ "$UDS_ACTION" == "install-dro" ]]; then + prompt_for_input "Provide DRO Namespace [Default:'redhat-marketplace']" DRO_NAMESPACE "redhat-marketplace" echo_highlight "DRO is configured to install in ${DRO_NAMESPACE} namespace" fi diff --git a/image/cli/mascli/functions/update b/image/cli/mascli/functions/update index 36293bdabe..096cbb219b 100644 --- a/image/cli/mascli/functions/update +++ b/image/cli/mascli/functions/update @@ -178,7 +178,7 @@ function validate_dro_migration() { echo "No storage class selected for DRO" fi if [[ "$NO_CONFIRM" != "true" ]] && [[ -z "${DRO_NAMESPACE}" ]]; then - prompt_for_input "Provide DRO Namespace [Default:'redhat-marketplace']" DRO_NAMESPACE + prompt_for_input "Provide DRO Namespace [Default:'redhat-marketplace']" DRO_NAMESPACE "redhat-marketplace" echo_highlight "DRO is configured to install in ${DRO_NAMESPACE} namespace" fi @@ -215,9 +215,6 @@ function validate_dro_migration() { else DRO_MIGRATION="false" echo -e "${COLOR_YELLOW}UDS does not exist, skipping DRO migration and proceeding with mas update" - if [[ -z "${DRO_NAMESPACE}" ]] || [[ "${DRO_NAMESPACE}" == "" ]]; then - DRO_NAMESPACE="redhat-marketplace" - fi DRO_CSV=$(oc get csv -n "${DRO_NAMESPACE}" | grep ibm-data-reporter-operator | awk '{print $1}') echo $DRO_CSV if [[ -n $DRO_CSV ]]; then @@ -879,6 +876,7 @@ function update() { if [ "$DRO_MIGRATION" = "true" ]; then echo_reset_dim "UDS to DRO ................................. ${COLOR_GREEN}Yes" echo_reset_dim " - DRO Storage Class ....................... ${COLOR_GREEN}${DRO_STORAGE_CLASS}" + echo_reset_dim " - DRO Namespace ........................... ${COLOR_GREEN}${DRO_NAMESPACE}" else echo_reset_dim "UDS to DRO ................................. ${COLOR_RED}Not Required" fi diff --git a/image/cli/mascli/templates/pipelinerun-install.yaml b/image/cli/mascli/templates/pipelinerun-install.yaml index 918bcade39..6cb71ceb21 100644 --- a/image/cli/mascli/templates/pipelinerun-install.yaml +++ b/image/cli/mascli/templates/pipelinerun-install.yaml @@ -252,7 +252,8 @@ spec: value: '$UDS_CONTACT_LASTNAME' - name: uds_action value: '$UDS_ACTION' - + - name: dro_namespace + value: '$DRO_NAMESPACE' # Dependencies - AppConnect # ------------------------------------------------------------------------- - name: appconnect_entitlement_username diff --git a/image/cli/mascli/templates/pipelinerun-update.yaml b/image/cli/mascli/templates/pipelinerun-update.yaml index ac637b4ac0..c96893c33a 100644 --- a/image/cli/mascli/templates/pipelinerun-update.yaml +++ b/image/cli/mascli/templates/pipelinerun-update.yaml @@ -48,6 +48,8 @@ spec: value: '$DRO_STORAGE_CLASS' - name: uds_action value: '$UDS_ACTION' + - name: dro_namespace + value: '$DRO_NAMESPACE' - name: grafana_v5_upgrade value: '$GRAFANA_V5_UPGRADE' diff --git a/tekton/src/pipelines/update.yml.j2 b/tekton/src/pipelines/update.yml.j2 index abd95b4a0e..1370299b8d 100644 --- a/tekton/src/pipelines/update.yml.j2 +++ b/tekton/src/pipelines/update.yml.j2 @@ -131,7 +131,6 @@ spec: - name: dro_namespace default: "redhat-marketplace" type: string - description: set custom namespace for DRO, default is redhat-marketplace' # grafana operator update - name: grafana_v5_upgrade