From 9907f91c4943c38027224d0119586e0de6c2ce79 Mon Sep 17 00:00:00 2001 From: Dmitry Dunaev Date: Fri, 28 Jan 2022 13:52:47 +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 | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index 64bf8fe..1c8a9ac 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -22,7 +22,7 @@ images: services: owsec: - type: LoadBalancer + type: ClusterIP ports: restapi: servicePort: 16001 diff --git a/readiness_check b/readiness_check index f2c383a..a8a5152 100755 --- a/readiness_check +++ b/readiness_check @@ -13,22 +13,23 @@ then 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_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 + export RESTAPI_PORT=$(grep 'openwifi.restapi.host.0.port' $OWSEC_CONFIG/owsec.properties | awk -F '=' '{print $2}' | xargs | envsubst) # Get OAuth token from OWSEC and cache it or use cached one payload="{ \"userId\" : \"$OWSEC_USERNAME\" , \"password\" : \"$OWSEC_PASSWORD\" }"