[Issue #473] Add Consul KV variable source #898
Merged
DeekshithaTimmareddy merged 9 commits intoJun 19, 2026
Merged
Conversation
Collaborator
Author
Added! adding integration tests and documentation will make this pr huge so limiting this pr to CLI integration and consumer code only |
tgross
requested changes
Jun 12, 2026
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
tgross
reviewed
Jun 17, 2026
tgross
reviewed
Jun 17, 2026
tgross
reviewed
Jun 17, 2026
tgross
reviewed
Jun 17, 2026
tgross
reviewed
Jun 17, 2026
tgross
reviewed
Jun 17, 2026
tgross
reviewed
Jun 17, 2026
Member
|
Tested end-to-end: |
tgross
reviewed
Jun 18, 2026
tgross
left a comment
Member
There was a problem hiding this comment.
This is looking pretty good! A few more minor items to resolve and I think this will be ready to merge.
Collaborator
Author
After this pr got merged, i will be focusing on integration tests and also documentation of this consul source in the follow up pr, let me know your comments |
7662888
into
feature/external-variable-sources
17 checks passed
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Description
This PR implements Subtask 2a of Issue #473 (External Variable Sources for
nomad-pack). It adds support for fetching pack variables from Consul KV, a shared
JSON→cty conversion utility, and the
--var-sourceCLI flag with fullintegration.
Key behaviors
URL-based config following standard URL rules:
consul:///<prefix>— Consul address from the environment (e.g.CONSUL_HTTP_ADDR)consul://<host>:<port>/<prefix>— explicit Consul addressDefault KV layout:
<prefix>/<pack-name>/<variable-name>.Pass
?full-path=trueto use<prefix>as-is (pack name not appended).Type-aware conversion: a Pack variable typed
stringkeeps the raw Consulbytes; only non-string types are JSON-decoded — no type-guessing before the
schema is known.
Parse/build split: only
run,plan, andrenderread remote sources.stopandgenerate varfiledo not accept--var-source, so stopping ajob never depends on a remote source still being reachable.
Variable precedence (highest → lowest):
--var)--var-source)--var-file)Testing
Test Data
Store variables in Consul:
Priority Override:
Multiple sources:
Priority: CLI > Consul File
Reminders
CHANGELOG.mdentryChanges to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.