Skip to content

feat: add --no-expand-env-vars flag to deck file convert#1977

Merged
mheap merged 1 commit intomainfrom
mheap/diplopic-tajuana
Apr 8, 2026
Merged

feat: add --no-expand-env-vars flag to deck file convert#1977
mheap merged 1 commit intomainfrom
mheap/diplopic-tajuana

Conversation

@mheap
Copy link
Copy Markdown
Member

@mheap mheap commented Apr 7, 2026

Why

deck file convert always expanded env placeholders (e.g. ${{ env "DECK_VAR_NAME" }}) in its output, with no way to suppress this. Users who want to convert format while keeping env references intact — for example, to commit the converted file and resolve secrets at deploy time — had no option to do so.

What changed

Added a --no-expand-env-vars boolean flag (default false) to deck file convert. When set, env placeholders are left unexpanded, matching the mock-env-vars behaviour already available in deck file render.

The flag is wired through both convert code paths: single-file conversion and the 2.x→3.x batch conversion.

Usage:

deck file convert --from kong-gateway-2.x --to kong-gateway-3.x \
  --input-file kong.yaml --no-expand-env-vars

Default behaviour is unchanged — env vars are still expanded unless the flag is passed.

@mheap mheap force-pushed the mheap/diplopic-tajuana branch from a884c35 to c119f86 Compare April 7, 2026 09:56
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 6.66667% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.52%. Comparing base (6719b2a) to head (456bff3).

Files with missing lines Patch % Lines
cmd/file_convert.go 0.00% 10 Missing ⚠️
cmd/file_render.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1977      +/-   ##
==========================================
- Coverage   32.58%   32.52%   -0.06%     
==========================================
  Files          77       77              
  Lines        6903     6914      +11     
==========================================
  Hits         2249     2249              
- Misses       4474     4485      +11     
  Partials      180      180              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mheap mheap marked this pull request as draft April 7, 2026 10:19
@mheap
Copy link
Copy Markdown
Member Author

mheap commented Apr 7, 2026

This implementation isn't correct. Instead, let's wait for Kong/go-database-reconciler#444 then use the new mode in this PR

@Prashansa-K
Copy link
Copy Markdown
Contributor

This implementation isn't correct. Instead, let's wait for Kong/go-database-reconciler#444 then use the new mode in this PR

🤔 But that PR uses this deck branches' commit ID in go.mod
If the implementation is incorrect, why are we creating this cycle?

@mheap mheap force-pushed the mheap/diplopic-tajuana branch from 0457350 to 914d21a Compare April 8, 2026 16:38
@mheap mheap added skip-konnect Skip Konnect Integration tests in CI skip-ee Skip Enterprise Integration Tests in CI skip-oss Skip Open Source Integration Tests in CI labels Apr 8, 2026
@mheap mheap force-pushed the mheap/diplopic-tajuana branch from 914d21a to 2d147bf Compare April 8, 2026 16:41
@mheap mheap marked this pull request as ready for review April 8, 2026 16:42
@harshadixit12 harshadixit12 self-requested a review April 8, 2026 16:44
@mheap mheap force-pushed the mheap/diplopic-tajuana branch from 2d147bf to ead162b Compare April 8, 2026 16:45
@mheap
Copy link
Copy Markdown
Member Author

mheap commented Apr 8, 2026

Implementation updated to use the GDR methods

@mheap mheap force-pushed the mheap/diplopic-tajuana branch from ead162b to 456bff3 Compare April 8, 2026 16:56
@mheap mheap merged commit b39a0f0 into main Apr 8, 2026
11 checks passed
@mheap mheap deleted the mheap/diplopic-tajuana branch April 8, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-ee Skip Enterprise Integration Tests in CI skip-konnect Skip Konnect Integration tests in CI skip-oss Skip Open Source Integration Tests in CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants