-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Feature request summary
This issue tracks allowing the parsing and passing of environmental variables from kraft build and kraft run via the command-line flag -e flag and an env element in the Kraftfile specification such that these key-values are correctly passed into posix-environ
-
In the case of
kraft build, these can be statically set at compile-time such that these variables are persistent with the unikernel. -
In the case of
kraft run, they are passed viauklibparamvia the syntax and requiring the KConfig optionCONFIG_LIBPOSIX_ENVIRON_LIBPARAM:env.vars=[ "${NAME0}=${VALUE0}" "${NAME1}=${VALUE1}" ]
When no key is provided, for example kraft run -e HOME, the value should be automatically determined from the host environment via os.Getenv.
A new wrapper library should be introduced in unikraft/export/v0/posix-environ to accommodate handling the list of key-value environmental variables and the correct format to be used when instantiating the VM.
To statically serialize environmental variables, a new top-level env element should be added to the Kraftfile specification such that these are passed in the same way to kraft build and kraft run.
Map form:
spec: v0.6
env:
KEY: valueList form:
spec: v0.6
env:
- KEY=valueDescribe alternatives
No response
Related architectures
None
Related platforms
None
Additional context
See posix-environ: Handling Environmental Variables for additional details.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status