Skip to content

Commit

Permalink
add virt-mode to Pod Deploy command
Browse files Browse the repository at this point in the history
Signed-off-by: Shahriyar Jalayeri <[email protected]>
  • Loading branch information
shjala committed Oct 29, 2024
1 parent 6ff41cd commit 0679fa5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/edenPod.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/lf-edge/eden/pkg/defaults"
"github.com/lf-edge/eden/pkg/openevec"
edgeRegistry "github.com/lf-edge/edge-containers/pkg/registry"
"github.com/lf-edge/eve-api/go/config"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/thediveo/enumflag"
Expand Down Expand Up @@ -76,6 +77,7 @@ func newPodPublishCmd() *cobra.Command {

func newPodDeployCmd(cfg *openevec.EdenSetupArgs) *cobra.Command {
var pc openevec.PodConfig
var virtMode int32 = int32(pc.VirtMode)

var podDeployCmd = &cobra.Command{
Use: "deploy (docker|http(s)|file|directory)://(<TAG|PATH>[:<VERSION>] | <URL for qcow2 image> | <path to qcow2 image>)",
Expand All @@ -88,6 +90,9 @@ func newPodDeployCmd(cfg *openevec.EdenSetupArgs) *cobra.Command {
log.Fatal(err)
}
},
PreRun: func(cmd *cobra.Command, args []string) {
pc.VirtMode = config.VmMode(virtMode)
},
}

podDeployCmd.Flags().StringVar(&pc.AppMemory, "memory", humanize.Bytes(defaults.DefaultAppMem*1024), "memory for app")
Expand Down Expand Up @@ -122,6 +127,7 @@ You can set access VLAN ID (VID) for a particular network in the format '<networ
podDeployCmd.Flags().StringVar(&pc.DatastoreOverride, "datastoreOverride", "", "Override datastore path for disks (when we use different URL for Eden and EVE or for local datastore)")
podDeployCmd.Flags().Uint32Var(&pc.StartDelay, "start-delay", 0, "The amount of time (in seconds) that EVE waits (after boot finish) before starting application")
podDeployCmd.Flags().BoolVar(&pc.PinCpus, "pin-cpus", false, "Pin the CPUs used by the pod")
podDeployCmd.Flags().Int32Var(&virtMode, "virt-mode", virtMode, "Virtualization mode for the pod (0 - PV, 1 - HVM, 2 - Filter, 3 - FML, 4 - NOHYPER, 5 - LEGACY)")

return podDeployCmd
}
Expand Down

0 comments on commit 0679fa5

Please sign in to comment.