Skip to content

Commit e977836

Browse files
committed
Added the ability to run with a custom --net parameter (host by default), closes #2
1 parent 04e14cc commit e977836

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

cmd/up.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"github.com/spf13/cobra"
1010
)
1111

12+
var net string = "default"
13+
1214
var upCmd = &cobra.Command{
1315
Use: "up",
1416
Short: "Run the container",
@@ -27,11 +29,17 @@ var upCmd = &cobra.Command{
2729
// that make it easy for dev
2830
// environments.
2931
func runAci() {
30-
command := "rkt --insecure-options=image --net=host run --interactive " + getMountConfig() + " " + getAciPath("dev")
32+
if net == "" {
33+
net = "host"
34+
}
35+
36+
command := fmt.Sprintf("rkt --insecure-options=image --net=%s --interactive=true %s run %s", net, getMountConfig(), getAciPath("dev"))
3137
fmt.Println(command)
3238
utils.Execute(strings.Split(command, " "), streams.NewStdIO())
3339
}
3440

3541
func init() {
3642
RootCmd.AddCommand(upCmd)
43+
44+
upCmd.Flags().StringVarP(&net, "net", "n", "", "configure the pod's networking. Optionally, pass a list of user-configured networks to load and set arguments to pass to each network, respectively. Syntax: --net[=n[:args], ...]")
3745
}

0 commit comments

Comments
 (0)