mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-30 03:51:43 +02:00
Support Bridged Network (#78)
* Support Bridged Network Inspired by https://github.com/cirruslabs/tart/issues/473 * Fixed tests
This commit is contained in:
@@ -13,7 +13,8 @@ var ErrVMFailed = errors.New("failed to create VM")
|
||||
var image string
|
||||
var cpu uint64
|
||||
var memory uint64
|
||||
var softnet bool
|
||||
var netSoftnet bool
|
||||
var netBridged string
|
||||
var headless bool
|
||||
var stringToStringResources map[string]string
|
||||
|
||||
@@ -28,7 +29,8 @@ func newCreateVMCommand() *cobra.Command {
|
||||
command.PersistentFlags().StringVar(&image, "image", "ghcr.io/cirruslabs/macos-ventura-base:latest", "image to use")
|
||||
command.PersistentFlags().Uint64Var(&cpu, "cpu", 4, "number of CPUs to use")
|
||||
command.PersistentFlags().Uint64Var(&memory, "memory", 8*1024, "megabytes of memory to use")
|
||||
command.PersistentFlags().BoolVar(&softnet, "softnet", false, "whether to use Softnet network isolation")
|
||||
command.PersistentFlags().BoolVar(&netSoftnet, "net-softnet", false, "whether to use Softnet network isolation")
|
||||
command.PersistentFlags().StringVar(&netBridged, "net-bridged", "", "whether to use Bridged network mode")
|
||||
command.PersistentFlags().BoolVar(&headless, "headless", true, "whether to run without graphics")
|
||||
command.PersistentFlags().StringToStringVar(&stringToStringResources, "resources", map[string]string{},
|
||||
"resources to request for this VM")
|
||||
@@ -54,11 +56,12 @@ func runCreateVM(cmd *cobra.Command, args []string) error {
|
||||
Meta: v1.Meta{
|
||||
Name: name,
|
||||
},
|
||||
Image: image,
|
||||
CPU: cpu,
|
||||
Memory: memory,
|
||||
Softnet: softnet,
|
||||
Headless: headless,
|
||||
Resources: resources,
|
||||
Image: image,
|
||||
CPU: cpu,
|
||||
Memory: memory,
|
||||
NetSoftnet: netSoftnet,
|
||||
NetBridged: netBridged,
|
||||
Headless: headless,
|
||||
Resources: resources,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user