From 4f5e3b15046004fb095aba1bcce5acfb7e53cdcd Mon Sep 17 00:00:00 2001 From: Oleksii Orel Date: Wed, 19 Jul 2023 16:35:52 +0300 Subject: [PATCH] fix: scripts for local run Signed-off-by: Oleksii Orel --- run/build-and-patch.sh | 4 ++-- run/local-run.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/run/build-and-patch.sh b/run/build-and-patch.sh index f6c94f281..1877a176b 100755 --- a/run/build-and-patch.sh +++ b/run/build-and-patch.sh @@ -36,9 +36,9 @@ echo "[INFO] Patching checluster with the new dashboard image '${CHE_DASHBOARD_I CHE_NAMESPACE="${CHE_NAMESPACE:-eclipse-che}" DASHBOARD_POD_NAME=$(kubectl get pods -n $CHE_NAMESPACE -o=custom-columns=:metadata.name | grep dashboard) CHECLUSTER_CR_NAME=$(kubectl exec $DASHBOARD_POD_NAME -n $CHE_NAMESPACE -- printenv CHECLUSTER_CR_NAME) -PREVIOUS_CHE_DASHBOARD_IMAGE=$(kubectl get checluster -n $CHE_NAMESPACE $CHECLUSTER_CR_NAME -o=json | jq -r '.items[0].spec.components.dashboard.deployment.containers[0].image') +PREVIOUS_CHE_DASHBOARD_IMAGE=$(kubectl get checluster -n $CHE_NAMESPACE $CHECLUSTER_CR_NAME -o=json | jq -r '.spec.components.dashboard.deployment.containers[0].image') -if [ "$PREVIOUS_CHE_DASHBOARD_IMAGE" = "null" ]; then +if [ "$PREVIOUS_CHE_DASHBOARD_IMAGE" == "null" ]; then kubectl patch -n "$CHE_NAMESPACE" "checluster/$CHECLUSTER_CR_NAME" --type=json -p="[{\"op\": \"replace\", \"path\": \"/spec/components/dashboard\", \"value\": {deployment: {containers: [{image: \"${CHE_DASHBOARD_IMAGE}\", name: che-dasboard}]}}}]" else kubectl patch -n "$CHE_NAMESPACE" "checluster/$CHECLUSTER_CR_NAME" --type=json -p="[{\"op\": \"replace\", \"path\": \"/spec/components/dashboard.deployment.containers[0].image\", \"value\": ${CHE_DASHBOARD_IMAGE}}]" diff --git a/run/local-run.sh b/run/local-run.sh index cc2415ff8..11df1f2f8 100755 --- a/run/local-run.sh +++ b/run/local-run.sh @@ -132,7 +132,7 @@ fi # consider renaming it to CHE_API_URL since it's not just host export CHE_HOST=http://localhost:8080 -export CHE_HOST_ORIGIN=$(kubectl get checluster -n $CHE_NAMESPACE $CHECLUSTER_CR_NAME -o=json | jq -r '.items[0].status.cheURL') +export CHE_HOST_ORIGIN=$(kubectl get checluster -n $CHE_NAMESPACE $CHECLUSTER_CR_NAME -o=json | jq -r '.status.cheURL') # do nothing PRERUN_COMMAND="echo"