From 8df3cf3a53ab374e2e73023985064671fd0326f2 Mon Sep 17 00:00:00 2001 From: Pavel Abramov Date: Fri, 9 Dec 2022 11:49:34 +0100 Subject: [PATCH] Remove DirectLoad from RuntimeConfig See #827 Signed-off-by: Pavel Abramov --- cmd/edenPod.go | 6 +++--- pkg/openevec/config.go | 1 - pkg/openevec/pod.go | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cmd/edenPod.go b/cmd/edenPod.go index c988c755f..5a797f030 100644 --- a/cmd/edenPod.go +++ b/cmd/edenPod.go @@ -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)://([:] | | )", @@ -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) } }, @@ -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 or :. Deprecated. Please use volumes instead.`) podDeployCmd.Flags().StringArrayVar(&cfg.Runtime.Mount, "mount", nil, `Additional volumes to use. You can write it in notation src=,dst=.`) diff --git a/pkg/openevec/config.go b/pkg/openevec/config.go index bc181bfce..76798161c 100644 --- a/pkg/openevec/config.go +++ b/pkg/openevec/config.go @@ -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"` diff --git a/pkg/openevec/pod.go b/pkg/openevec/pod.go index 239d38bd7..e12be41f4 100644 --- a/pkg/openevec/pod.go +++ b/pkg/openevec/pod.go @@ -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 { @@ -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