From ed1ffdbe7fcd0733623050e4aa460afadb938e40 Mon Sep 17 00:00:00 2001 From: Khurram Baig Date: Wed, 13 Sep 2023 19:34:00 +0530 Subject: [PATCH] Remove Config Values as Env var in API server Move these config to configmap so that changing configmap configures the value. --- config/base/api.yaml | 2 -- config/base/env/config | 4 +-- config/components/local-db/api.yaml | 26 ------------------- config/components/local-db/kustomization.yaml | 6 ----- test/e2e/gcs-emulator.yaml | 4 +-- 5 files changed, 4 insertions(+), 38 deletions(-) delete mode 100644 config/components/local-db/api.yaml diff --git a/config/base/api.yaml b/config/base/api.yaml index 8a2c3b21d..8c1775346 100644 --- a/config/base/api.yaml +++ b/config/base/api.yaml @@ -46,8 +46,6 @@ spec: secretKeyRef: name: tekton-results-postgres key: POSTGRES_PASSWORD - - name: DB_NAME - value: tekton-results volumeMounts: - name: config mountPath: /etc/tekton/results diff --git a/config/base/env/config b/config/base/env/config index 721ce3117..1ef6da78f 100644 --- a/config/base/env/config +++ b/config/base/env/config @@ -1,8 +1,8 @@ DB_USER= DB_PASSWORD= -DB_HOST= +DB_HOST=tekton-results-postgres-service.tekton-pipelines.svc.cluster.local DB_PORT=5432 -DB_NAME= +DB_NAME=tekton-results DB_SSLMODE=disable DB_SSLROOTCERT= DB_ENABLE_AUTO_MIGRATION=true diff --git a/config/components/local-db/api.yaml b/config/components/local-db/api.yaml deleted file mode 100644 index 931bc9433..000000000 --- a/config/components/local-db/api.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2023 The Tekton Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: api -spec: - template: - spec: - containers: - - name: api - env: - - name: DB_HOST - value: tekton-results-postgres-service.tekton-pipelines.svc.cluster.local diff --git a/config/components/local-db/kustomization.yaml b/config/components/local-db/kustomization.yaml index f34094508..572ff8f06 100644 --- a/config/components/local-db/kustomization.yaml +++ b/config/components/local-db/kustomization.yaml @@ -21,9 +21,3 @@ kind: Component resources: - 201-sql-deployment.yaml - -patches: -- target: - kind: Deployment - name: api - path: api.yaml diff --git a/test/e2e/gcs-emulator.yaml b/test/e2e/gcs-emulator.yaml index c01491f84..4988f59be 100644 --- a/test/e2e/gcs-emulator.yaml +++ b/test/e2e/gcs-emulator.yaml @@ -72,9 +72,9 @@ data: config: | DB_USER= DB_PASSWORD= - DB_HOST= + DB_HOST=tekton-results-postgres-service.tekton-pipelines.svc.cluster.local DB_PORT=5432 - DB_NAME= + DB_NAME=tekton-results DB_SSLMODE=disable DB_ENABLE_AUTO_MIGRATION=true SERVER_PORT=8080