-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow runtime to be selected via CLAB_RUNTIME environment variable
- Loading branch information
Showing
2 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ package clab | |
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
"path" | ||
"strings" | ||
"sync" | ||
|
@@ -58,6 +59,12 @@ func WithTimeout(dur time.Duration) ClabOption { | |
|
||
func WithRuntime(name string, d bool, dur time.Duration, gracefulShutdown bool) ClabOption { | ||
return func(c *CLab) { | ||
if name == "" { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
steiler
Author
Collaborator
|
||
name = os.Getenv("CLAB_RUNTIME") | ||
if name == "" { | ||
name = runtime.DockerRuntime | ||
} | ||
} | ||
if rInit, ok := runtime.ContainerRuntimes[name]; ok { | ||
c.Runtime = rInit() | ||
err := c.Runtime.Init( | ||
|
This file contains 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
This looks weird. Maybe a switch?