message: allow force-idling of services
diff: @@ -58,20 +58,26 @@ echo "$DEVELOPMENT_ENVIRONMENTS" | jq -c '.data.developmentEnvironments[] | sele
  continue
  fi
  + # if we need to force idling of development environments we can use flag force `./idle-services.sh force` to skip all checks and proceed to idling
  + if [ "$1" == "force" ]; then
  + echo "force idling"
  + IDLE_PODS=true
  + else
  + # else we just do normal idling checks
  NO_BUILDS=false
  PODS_RUNNING=false
  # Check for any running builds
  RUNNING_BUILDS=$(oc --insecure-skip-tls-verify --token="$OPENSHIFT_TOKEN" --server="$OPENSHIFT_URL" -n "$ENVIRONMENT_OPENSHIFT_PROJECTNAME" get --no-headers=true builds | grep "Running" | wc -l | tr -d ' ')
  if [ ! $? -eq 0 ]; then
  - echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME: $deploymentconfig: error checking build status"
  + echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME: error checking build status"
  continue
  elif [ "$RUNNING_BUILDS" == "0" ]; then
  # Now we can scale
  - echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME: $deploymentconfig: no running builds"
  + echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME: no running builds"
  NO_BUILDS=true
  else
  - echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME: $deploymentconfig: has $RUNNING_BUILDS running builds, skipping"
  + echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME: has $RUNNING_BUILDS running builds, skipping"
  continue
  fi
  @@ -90,6 +96,11 @@ echo "$DEVELOPMENT_ENVIRONMENTS" | jq -c '.data.developmentEnvironments[] | sele
  PODS_RUNNING=true
  fi
  done
  + if [ "$PODS_RUNNING" == false ]; then
  + echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME - $deployment running less than interval, skipping"
  + fi
  + else
  + echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME - $deployment no running pods, skipping"
  fi
  done
  @@ -122,6 +133,11 @@ echo "$DEVELOPMENT_ENVIRONMENTS" | jq -c '.data.developmentEnvironments[] | sele
  echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME had $HITS hits in last four hours, no idling"
  else
  echo "$OPENSHIFT_URL - $PROJECT_NAME: $ENVIRONMENT_NAME had no hits in last four hours, starting to idle"
  + IDLE_PODS=true
  + fi
  + fi
  + fi
  + if [ "$IDLE_PODS" == "true" ]; then
  # actually idling happens here
  oc --insecure-skip-tls-verify --token="$OPENSHIFT_TOKEN" --server="$OPENSHIFT_URL" -n "$ENVIRONMENT_OPENSHIFT_PROJECTNAME" idle -l "service notin (mariadb,postgres)"
  @@ -139,7 +155,6 @@ echo "$DEVELOPMENT_ENVIRONMENTS" | jq -c '.data.developmentEnvironments[] | sele
  fi
  fi
  fi
  - fi
  done # environment loop
  else
  echo "$OPENSHIFT_URL - $PROJECT_NAME: has autoidle set to $AUTOIDLE "
  