Skip to content

Commit

Permalink
Remove DirectLoad from RuntimeConfig
Browse files Browse the repository at this point in the history
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
  • Loading branch information
uncleDecart committed Dec 15, 2022
1 parent 8f76579 commit 8df3cf3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cmd/edenPod.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func newPodDeployCmd(cfg *openevec.EdenSetupArgs) *cobra.Command {
var appCpus uint32
var pinCpus bool
var imageFormat string
var sftpLoad bool
var sftpLoad, directLoad bool

var podDeployCmd = &cobra.Command{
Use: "deploy (docker|http(s)|file|directory)://(<TAG|PATH>[:<VERSION>] | <URL for qcow2 image> | <path to qcow2 image>)",
Expand All @@ -93,7 +93,7 @@ func newPodDeployCmd(cfg *openevec.EdenSetupArgs) *cobra.Command {
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
appLink := args[0]
if err := openevec.PodDeploy(appLink, podName, podMetadata, podNetworks, portPublish, acl, vlans, noHyper, vncDisplay, vncPassword, diskSize, volumeSize, appMemory, volumeType, appCpus, pinCpus, imageFormat, sftpLoad, cfg); err != nil {
if err := openevec.PodDeploy(appLink, podName, podMetadata, podNetworks, portPublish, acl, vlans, noHyper, vncDisplay, vncPassword, diskSize, volumeSize, appMemory, volumeType, appCpus, pinCpus, imageFormat, sftpLoad, directLoad, cfg); err != nil {
log.Fatal(err)
}
},
Expand All @@ -114,7 +114,7 @@ func newPodDeployCmd(cfg *openevec.EdenSetupArgs) *cobra.Command {
podDeployCmd.Flags().BoolVar(&cfg.Runtime.ACLOnlyHost, "only-host", false, "Allow access only to host and external networks")
podDeployCmd.Flags().BoolVar(&noHyper, "no-hyper", false, "Run pod without hypervisor")
podDeployCmd.Flags().StringVar(&cfg.Runtime.Registry, "registry", "remote", "Select registry to use for containers (remote/local)")
podDeployCmd.Flags().BoolVar(&cfg.Runtime.DirectLoad, "direct", true, "Use direct download for image instead of eserver")
podDeployCmd.Flags().BoolVar(&directLoad, "direct", true, "Use direct download for image instead of eserver")
podDeployCmd.Flags().BoolVar(&sftpLoad, "sftp", false, "Force use of sftp to load http/file image from eserver")
podDeployCmd.Flags().StringSliceVar(&cfg.Runtime.Disks, "disks", nil, `Additional disks to use. You can write it in notation <link> or <mount point>:<link>. Deprecated. Please use volumes instead.`)
podDeployCmd.Flags().StringArrayVar(&cfg.Runtime.Mount, "mount", nil, `Additional volumes to use. You can write it in notation src=<link>,dst=<mount point>.`)
Expand Down
1 change: 0 additions & 1 deletion pkg/openevec/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ type RegistryConfig struct {
}

type RuntimeConfig struct {
DirectLoad bool `cobraflag:"direct"`
Mount []string `cobraflag:"mount"`
Disks []string `cobraflag:"disks"`
Registry string `cobraflag:"registry"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/openevec/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func processVLANs(vlans []string) (map[string]int, error) {
return m, nil
}

func PodDeploy(appLink, podName, podMetadata string, podNetworks, portPublish, acl, vlans []string, noHyper bool, vncDisplay uint32, vncPassword, diskSize, volumeSize, appMemory, volumeType string, appCpus uint32, pinCpus bool, imageFormat string, sftpLoad bool, cfg *EdenSetupArgs) error {
func PodDeploy(appLink, podName, podMetadata string, podNetworks, portPublish, acl, vlans []string, noHyper bool, vncDisplay uint32, vncPassword, diskSize, volumeSize, appMemory, volumeType string, appCpus uint32, pinCpus bool, imageFormat string, sftpLoad, directLoad bool, cfg *EdenSetupArgs) error {
changer := &adamChanger{}
ctrl, dev, err := changer.getControllerAndDev()
if err != nil {
Expand Down Expand Up @@ -120,7 +120,7 @@ func PodDeploy(appLink, podName, podMetadata string, podNetworks, portPublish, a
opts = append(opts, expect.WithVLANs(vlansParsed))
opts = append(opts, expect.WithSFTPLoad(sftpLoad))
if !sftpLoad {
opts = append(opts, expect.WithHTTPDirectLoad(cfg.Runtime.DirectLoad))
opts = append(opts, expect.WithHTTPDirectLoad(directLoad))
}
opts = append(opts, expect.WithAdditionalDisks(append(cfg.Runtime.Disks, cfg.Runtime.Mount...)))
registryToUse := cfg.Runtime.Registry
Expand Down

0 comments on commit 8df3cf3

Please sign in to comment.