feat(config): Add option to use profile from env - #420
Open
craciunoiuc wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in “env-derived” configuration mode to the CLI’s config layer, allowing a virtual profile to be synthesized from environment variables (and refactors the legacy env hydration logic into reusable helpers).
Changes:
- Refactors legacy profile hydration into
profileFromEnv/metroFromEnvhelpers. - Adds
UNIKRAFT_PROFILE_ENVsupport soCurrentProfile()can bypass on-disk config and return an env-derived profile. - Adds unit tests covering env-profile enable/disable behavior and precedence over the config file.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| internal/config/profile.go | Adds env-derived profile selection in CurrentProfile() and refactors env parsing into helper functions. |
| internal/config/config_test.go | Adds tests for env-derived profile behavior and config bypass precedence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
craciunoiuc
force-pushed
the
craciunoiuc/add-var-usage
branch
from
July 15, 2026 13:11
eada3fc to
ad587f1
Compare
jedevc
reviewed
Jul 23, 2026
Reads four new environmental variables: - UNIKRAFT_PROFILE_ENV=true/false - UKC_TOKEN=<string> - UKC_METRO=<string> - UKC_ALLOW_INSECURE=true/false Signed-off-by: Cezar Craciunoiu <cezar@unikraft.io>
craciunoiuc
force-pushed
the
craciunoiuc/add-var-usage
branch
from
July 24, 2026 07:34
ad587f1 to
314489d
Compare
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.
Reads four new environmental variables:
Closes: TOOL-1163