Skip to content

feat(config): Add option to use profile from env - #420

Open
craciunoiuc wants to merge 1 commit into
prod-stagingfrom
craciunoiuc/add-var-usage
Open

feat(config): Add option to use profile from env#420
craciunoiuc wants to merge 1 commit into
prod-stagingfrom
craciunoiuc/add-var-usage

Conversation

@craciunoiuc

@craciunoiuc craciunoiuc commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Reads four new environmental variables:

  • UNIKRAFT_PROFILE_ENV=true/false
  • UKC_TOKEN=<string>
  • UKC_METRO=<string>
  • UKC_ALLOW_INSECURE=true/false

Closes: TOOL-1163

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / metroFromEnv helpers.
  • Adds UNIKRAFT_PROFILE_ENV support so CurrentProfile() 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.

Comment thread internal/config/profile.go Outdated
Comment thread internal/config/profile.go
Comment thread internal/config/config_test.go
Comment thread internal/config/config_test.go
@craciunoiuc
craciunoiuc force-pushed the craciunoiuc/add-var-usage branch from eada3fc to ad587f1 Compare July 15, 2026 13:11
Comment thread internal/config/profile.go
Comment thread internal/config/profile.go Outdated
Comment thread internal/config/profile.go Outdated
Comment thread internal/config/profile.go
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
craciunoiuc force-pushed the craciunoiuc/add-var-usage branch from ad587f1 to 314489d Compare July 24, 2026 07:34
@craciunoiuc
craciunoiuc requested a review from jedevc July 24, 2026 07:36
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.

3 participants