Skip to content

Commit

Permalink
Merge branch 'master' into feature/ui-adding-filters-to-problems-tab-…
Browse files Browse the repository at this point in the history
…1-x-master
  • Loading branch information
Toby Bellwood authored Feb 23, 2021
2 parents fa38fa1 + 94d4d00 commit 8946da1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions services/ssh/home/rsh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ fi
if [[ $($OC get deployment -l "lagoon.sh/service=${SERVICE}" 2> /dev/null) ]]; then
DEPLOYMENT=$($OC get deployment -l "lagoon.sh/service=${SERVICE}" -o name)
# If the deployment is scaled to 0, scale to 1
if [[ $($OC get ${DEPLOYMENT} -o go-template --template='{{.status.replicas}}') == "0" ]]; then
# .status.replicas doesn't exist on a scaled to 0 deployment in k8s so assume it is 0 if nothing is returned
if [[ $($OC get ${DEPLOYMENT} -o json | jq -r '.status.replicas // 0') == "0" ]]; then

$OC scale --replicas=1 ${DEPLOYMENT} >/dev/null 2>&1

Expand All @@ -139,7 +140,8 @@ fi
if [[ $($OC get deployment -l lagoon/service=${SERVICE} 2> /dev/null) ]]; then
DEPLOYMENT=$($OC get deployment -l lagoon/service=${SERVICE} -o name)
# If the deployment is scaled to 0, scale to 1
if [[ $($OC get ${DEPLOYMENT} -o go-template --template='{{.status.replicas}}') == "0" ]]; then
# .status.replicas doesn't exist on a scaled to 0 deployment in k8s so assume it is 0 if nothing is returned
if [[ $($OC get ${DEPLOYMENT} -o json | jq -r '.status.replicas // 0') == "0" ]]; then

$OC scale --replicas=1 ${DEPLOYMENT} >/dev/null 2>&1

Expand Down

0 comments on commit 8946da1

Please sign in to comment.