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

feat: Add flag to render allowing DECK_ env var processing #1208

Merged
merged 3 commits into from
Mar 6, 2024

Conversation

rspurgeon
Copy link
Collaborator

Resolves #1207

By default deck file render mocks the values of DECK_ env vars. This was intentional as to support rendering a full configuration in environments where all values are not present (ex: CI systems). This PR adds a flag for deck file render, --populate-env-vars with a default of false. The flag is written in the affirmative case while the false default prevents breaking previous default behavior. Users interested in populating the env vars must set --populate-env-vars to enable the behavior.

DECK_ECHO_DOWNSTREAM=true DECK_HEADER_NAME=X-Flag ./deck file render ~/kong/tmp/deck-file-render-1207.yaml
_format_version: "3.0"
plugins:
- config:
    echo_downstream: false
    generator: uuid
    header_name: DECK_HEADER_NAME
  enabled: true
  name: correlation-id
  protocols:
  - grpc
  - grpcs
  - http
  - https
> DECK_ECHO_DOWNSTREAM=true DECK_HEADER_NAME=X-Flag ./deck file render ~/kong/tmp/deck-file-render-1207.yaml --populate-env-vars
_format_version: "3.0"
plugins:
- config:
    echo_downstream: true
    generator: uuid
    header_name: X-Flag
  enabled: true
  name: correlation-id
  protocols:
  - grpc
  - grpcs
  - http
  - https

@rspurgeon rspurgeon requested a review from a team as a code owner February 6, 2024 16:27
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (9efd8b4) 5.53% compared to head (8abae6e) 5.53%.
Report is 6 commits behind head on main.

Files Patch % Lines
cmd/file_render.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1208      +/-   ##
========================================
- Coverage   5.53%   5.53%   -0.01%     
========================================
  Files         32      32              
  Lines       3360    3363       +3     
========================================
  Hits         186     186              
- Misses      3164    3167       +3     
  Partials      10      10              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rspurgeon rspurgeon merged commit fcc2ece into main Mar 6, 2024
38 of 39 checks passed
@rspurgeon rspurgeon deleted the render-add-flag-for-env-vars branch March 6, 2024 14:16
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.

deck file render - env substition does not work with string values
3 participants