diff --git a/chart/ms-dep-pkg-r/Chart.yaml b/chart/ms-dep-pkg-r/Chart.yaml index 4ad2458..fd97787 100644 --- a/chart/ms-dep-pkg-r/Chart.yaml +++ b/chart/ms-dep-pkg-r/Chart.yaml @@ -15,4 +15,4 @@ name: ms-dep-pkg-r description: Dependency Packages type: application icon: https://ortelius.github.io/ortelius-charts/logo.png -version: "10.0.0-build.43" +version: "10.0.0-build.44" diff --git a/chart/ms-dep-pkg-r/templates/deployment.yaml b/chart/ms-dep-pkg-r/templates/deployment.yaml index ec13a12..4cec03c 100644 --- a/chart/ms-dep-pkg-r/templates/deployment.yaml +++ b/chart/ms-dep-pkg-r/templates/deployment.yaml @@ -35,8 +35,6 @@ spec: image: "{{ .Values.DockerRepo }}:{{ .Values.DockerTag }}" imagePullPolicy: Always env: - - name: VALIDATEUSER_URL - value: {{ .Values.ValidateUserUrl | default "http://ms-validate-user.{{ metadata.namespace }}.svc.cluster.local" }} - name: DB_USER valueFrom: secretKeyRef: diff --git a/main.py b/main.py index 0df9bd1..8de5f02 100644 --- a/main.py +++ b/main.py @@ -42,7 +42,12 @@ db_user = os.getenv("DB_USER", "postgres") db_pass = os.getenv("DB_PASS", "postgres") db_port = os.getenv("DB_PORT", "5432") -validateuser_url = os.getenv("VALIDATEUSER_URL", "http://localhost:5000") +validateuser_url = os.getenv('VALIDATEUSER_URL', None ) + +if (validateuser_url is None): + validateuser_host = os.getenv('MS_VALIDATE_USER_SERVICE_HOST', '127.0.0.1') + host = socket.gethostbyaddr(validateuser_host)[0] + validateuser_url = 'http://' + host + ':' + str(os.getenv('MS_VALIDATE_USER_SERVICE_PORT', 80)) engine = create_engine("postgresql+psycopg2://" + db_user + ":" + db_pass + "@" + db_host + ":" + db_port + "/" + db_name, pool_pre_ping=True)