Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TektonResult DB_HOST and DB_NAME are ignored #1871

Open
maxhov opened this issue Nov 22, 2023 · 2 comments
Open

TektonResult DB_HOST and DB_NAME are ignored #1871

maxhov opened this issue Nov 22, 2023 · 2 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@maxhov
Copy link

maxhov commented Nov 22, 2023

Expected Behavior

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.

Steps to Reproduce the Problem

  1. Deploy Tekton operator (latest)
  2. Follow the deployment steps to deploy an external database described here: https://tekton.dev/docs/operator/tektonresult/#external-db
  3. Define a TektonResult config as follows:
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonResult
metadata:
  name: result
spec:
  targetNamespace: tekton-pipelines
  db_host: localhost
  db_port: 5432
  is_external_db: true
  1. Observe that the deployed results api service is not using the provided db_host and db_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?

@maxhov maxhov added the kind/bug Categorizes issue or PR as related to a bug. label Nov 22, 2023
@maxhov maxhov changed the title TektonResult DB_HOST and DB_NAME ignored TektonResult DB_HOST and DB_NAME are ignored Nov 22, 2023
@vdemeester
Copy link
Member

cc @khrm

@khrm
Copy link
Contributor

khrm commented Nov 22, 2023

/assign @khrm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants