From 502b72ddca896d64b329b753c2be4550a7516a3b Mon Sep 17 00:00:00 2001 From: Dmitry Dunaev Date: Fri, 28 Jan 2022 13:56:16 +0300 Subject: [PATCH] [WIFI-6837] Chg: modify readiness to make some envs optional, switch default helm service type to ClusterIP Signed-off-by: Dmitry Dunaev --- helm/values.yaml | 2 +- readiness_check | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index 10d757f..9dd1d8f 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -22,7 +22,7 @@ images: services: owprov: - type: LoadBalancer + type: ClusterIP ports: restapi: servicePort: 16005 diff --git a/readiness_check b/readiness_check index 94ae6fb..08b5dcf 100755 --- a/readiness_check +++ b/readiness_check @@ -13,29 +13,29 @@ then exit 1 fi -if [[ "${OWSEC}" == "" ]] -then - echo "You must set the variable OWSEC in order to use this script. Something like" - echo "OWSEC=security.isp.com:16001" - exit 1 -fi - -if [[ "${OWSEC_USERNAME}" == "" ]] -then - echo "You must set the variable OWSEC_USERNAME in order to use this script. Something like" - echo "OWSEC_USERNAME=tip@ucentral.com" - exit 1 -fi - -if [[ "${OWSEC_PASSWORD}" == "" ]] -then - echo "You must set the variable OWSEC_PASSWORD in order to use this script. Something like" - echo "OWSEC_PASSWORD=openwifi" - exit 1 -fi - if [[ "${READINESS_METHOD}" == "systeminfo" ]] then + if [[ "${OWSEC}" == "" ]] + then + echo "You must set the variable OWSEC in order to use this script. Something like" + echo "OWSEC=security.isp.com:16001" + exit 1 + fi + + if [[ "${OWSEC_USERNAME}" == "" ]] + then + echo "You must set the variable OWSEC_USERNAME in order to use this script. Something like" + echo "OWSEC_USERNAME=tip@ucentral.com" + exit 1 + fi + + if [[ "${OWSEC_PASSWORD}" == "" ]] + then + echo "You must set the variable OWSEC_PASSWORD in order to use this script. Something like" + echo "OWSEC_PASSWORD=openwifi" + exit 1 + fi + # Get OAuth token from OWSEC and cache it or use cached one payload="{ \"userId\" : \"$OWSEC_USERNAME\" , \"password\" : \"$OWSEC_PASSWORD\" }" if [[ -f "/tmp/token" ]]