Skip to content

Bug(env-expanding): Commented env variables should not be expanded #613

@erezrokah

Description

@erezrokah

Describe the bug

Given the following configuration:

kind: source
spec:
  name: "azure"
  path: "cloudquery/azure"
  version: "v3.3.0"
  tables: ["*"]
  destinations: ["postgresql"]
  concurrency: 1000
  spec:
    subscriptions:
      - 21e0d134-5da8-4754-8587-c58425d93de5
---
kind: destination
spec:
  name: "postgresql"
  path: "cloudquery/postgresql"
  version: "v2.0.5"
  write_mode: "overwrite-delete-stale"
  spec:
    # connection_string: ${TEST_STRING}
    connection_string: postgresql://postgres:pass@localhost:5432/postgres

Running cloudquery sync <path-to-config> you get an error if the TEST_STRING variable is not set

Expected Behavior

Don't fail on missing env vars in comments

Steps to Reproduce

Run cloudquery sync with the provider configuration

Possible Solution

Ignore comments when expanding env variables

Provider and CloudQuery version

cloudquery version 2.1.0

Additional Context

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions