Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass environment variables to OCI runtime #7

Closed
mgjm opened this issue Jun 27, 2023 · 3 comments
Closed

Pass environment variables to OCI runtime #7

mgjm opened this issue Jun 27, 2023 · 3 comments
Labels
PR Upstream PR created

Comments

@mgjm
Copy link
Owner

mgjm commented Jun 27, 2023

Add a new option to CreateContainerConfig to pass environment variables to OCI runtime.

type CreateContainerConfig struct {
    ...

    // EnvVars are the environment variables passed to the create runtime call,
    // in the form "key=value"
    EnvVars []string
}

Nice to have:

func (c *CreateContainerConfig) AddEnvVar(key, value string) {
    c.EnvVars = append(c.EnvVars, fmt.Sprintf("%s=%s", key, value))
}
@mgjm mgjm added the blocking Needs to be fixed to continue label Jun 27, 2023
@mgjm mgjm added this to the 1: Basic Functions milestone Jun 27, 2023
@mgjm
Copy link
Owner Author

mgjm commented Jul 6, 2023

Implemented in mgjm-fork/podman@a17e317 and mgjm-fork/conmon-rs@e91893a.

Should we add the helper function to add env vars?

Alternative encoding: Go prefers to use env vars strings with "key=value", rust uses maps or tuples to represent env vars. What should we use at the protocol level?

@mgjm mgjm added review Waiting for review and removed blocking Needs to be fixed to continue labels Jul 6, 2023
@mgjm
Copy link
Owner Author

mgjm commented Jul 7, 2023

Change them to actual Map

@mgjm
Copy link
Owner Author

mgjm commented Jul 12, 2023

@mgjm mgjm added PR Upstream PR created and removed review Waiting for review labels Jul 12, 2023
@mgjm mgjm closed this as completed Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR Upstream PR created
Projects
None yet
Development

No branches or pull requests

1 participant