Skip to content

Commit

Permalink
[patch] code refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuvraj Vansure committed Jun 14, 2024
1 parent 806da6f commit 7178f81
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions image/cli/mascli/functions/install
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function install_noninteractive() {
export UDS_CONTACT_LASTNAME=$1 && shift
;;
# DRO
-dro-namespace)
--dro-namespace)
export DRO_NAMESPACE=$1 && shift
;;

Expand Down Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions image/cli/mascli/functions/update
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion image/cli/mascli/templates/pipelinerun-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions image/cli/mascli/templates/pipelinerun-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
1 change: 0 additions & 1 deletion tekton/src/pipelines/update.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7178f81

Please sign in to comment.