MCPcopy Index your code
hub / github.com/coder/envbox / cmdLineEnvs

Function cmdLineEnvs

integration/integrationtest/docker.go:336–359  ·  view source on GitHub ↗

cmdLineEnvs returns args passed to the /envbox command but using their env var alias.

(c *CreateDockerCVMConfig)

Source from the content-addressed store, hash-verified

334// cmdLineEnvs returns args passed to the /envbox command
335// but using their env var alias.
336func cmdLineEnvs(c *CreateDockerCVMConfig) []string {
337 envs := []string{
338 EnvVar(cli.EnvInnerImage, c.Image),
339 EnvVar(cli.EnvInnerUsername, c.Username),
340 }
341
342 if len(c.InnerEnvFilter) > 0 {
343 envs = append(envs, EnvVar(cli.EnvInnerEnvs, strings.Join(c.InnerEnvFilter, ",")))
344 }
345
346 if c.AddFUSE {
347 envs = append(envs, EnvVar(cli.EnvAddFuse, "true"))
348 }
349
350 if c.AddTUN {
351 envs = append(envs, EnvVar(cli.EnvAddTun, "true"))
352 }
353
354 if c.BootstrapScript != "" {
355 envs = append(envs, EnvVar(cli.EnvBootstrap, c.BootstrapScript))
356 }
357
358 return envs
359}
360
361func EnvVar(k, v string) string {
362 return fmt.Sprintf("%s=%s", k, v)

Callers 1

RunEnvboxFunction · 0.85

Calls 1

EnvVarFunction · 0.85

Tested by

no test coverage detected