When using an external DB and setting the db_host and db_name parameters in TektonResult, I would expect that these setting are used.
Actual Behavior
The db_host and db_name settings are ignored and the defaults for db_host (tekton-results-postgres-service.tekton-pipelines.svc.cluster.local) and db_name (tekton-results) are used, regardless of the parameters set in the TektonResult.
Expected Behavior
When using an external DB and setting the
db_host
anddb_name
parameters inTektonResult
, I would expect that these setting are used.Actual Behavior
The
db_host
anddb_name
settings are ignored and the defaults fordb_host
(tekton-results-postgres-service.tekton-pipelines.svc.cluster.local) anddb_name
(tekton-results) are used, regardless of the parameters set in theTektonResult
.Steps to Reproduce the Problem
Deploy Tekton operator (latest)
Follow the deployment steps to deploy an external database described here: https://tekton.dev/docs/operator/tektonresult/#external-db
Define a
TektonResult
config as follows:Observe that the deployed results api service is not using the provided
db_host
anddb_name
. It should be shown in the logs.Additional Info
Kubernetes version: Client Version: v1.28.2 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.27.2
Tekton Pipeline version: v0.50.3
Possible cause
The DB_HOST and DB_NAME environment variables seem to be statically set in the Deployment of the api server. My best guess is that the environment variables override the provided settings here: https://github.com/tektoncd/results/blob/11ea190c693471a8171c24de4a6507f792c5efd9/pkg/api/server/config/config.go#L52 and thus the provided config is ignored. Is it intended that the DB_HOST and DB_NAME are set in the deployment?