Skip to content

Enhance Operator & CUE to Inject Formatted DB Connection Strings #60

@NgocAnhDo26

Description

@NgocAnhDo26

Background

Our K8s Operator (via CUE) injects DB_HOST, DB_USER, etc., when a database trait is used. However, PostgREST and Hasura need a fully formatted DATABASE_URL string (e.g., postgres://user:pass@host:5432/db).

Specific Steps

  • Navigate to cue/definitions and locate the logic handling the database trait.
  • Update the CUE templates to construct and inject a DATABASE_URL environment variable into the Component's Deployment, combining the existing secret refs.
  • Add unit tests in CUE (cue test) and Go to verify string injection.
  • Test locally to ensure existing Postgres deployments aren't broken.

Expected Output

A PR modifying CUE engine to inject DATABASE_URL into deployment workloads seamlessly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions