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

internal/controller: support custom atlas.hcl #244

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

datdao
Copy link
Member

@datdao datdao commented Dec 11, 2024

What does this PR do?

This PR introduces support for new methods of injecting atlas.hcl definitions, providing greater flexibility in specifying configurations. The following features are now supported:

  • Inline Block Configuration
spec:
  envName: "example"
  config: |
    env "example" {
        lint {

        }
    }
  • Configuration from a Secret
spec:
  envName: "example"
  configFrom:
    secretKeyRef:
        name: schema-config
        key: config.hcl
  • Variables from secret/configmap
spec:
  envName: "example"
  vars:
    - name: db_url
      value: "localhost"
    - name: db_url_from_secret
      valueFrom:
        secretKeyRef:
          name: schema-config
          key: db_url
    - name: db_url_from_configmap
      valueFrom:
        configMapKeyRef:
          name: schema-config
          key: db_url
  config: |
    variable "db_url" {}
    env "example" {
      url = var.db_url
    }

Limitations

  • Lint values that contain expressions are not yet supported in atlas.hcl.
  • Configurations involving multiple targets in atlas.hcl are currently not supported.

@datdao datdao force-pushed the d/custom-atlas-config branch from 30dc706 to 2ad336e Compare December 12, 2024 10:27
@datdao datdao force-pushed the d/custom-atlas-config branch 3 times, most recently from 56e9919 to 261ba24 Compare December 13, 2024 11:06
@datdao datdao force-pushed the d/custom-atlas-config branch from cc9ac78 to 3cd7c8e Compare December 23, 2024 04:05
@datdao datdao requested a review from giautm December 23, 2024 04:49
@datdao datdao marked this pull request as ready for review December 23, 2024 04:49
@datdao datdao requested review from rotemtam and a8m December 23, 2024 04:50
Comment on lines +123 to +132
variable "db_url" {
type = string
}
variable "dev_db_url" {
type = string
}
env "test" {
url = var.db_url
dev = var.dev_db_url
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write more complicated tests: Use Getenv, datasource for load token,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants