Skip to content

Commit

Permalink
Remove Viper from openEVEC EdenVolume
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
  • Loading branch information
uncleDecart committed Nov 7, 2023
1 parent 8badd25 commit d4aeb04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions cmd/edenVolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ package cmd
import (
"github.com/dustin/go-humanize"
"github.com/lf-edge/eden/pkg/controller/types"
"github.com/lf-edge/eden/pkg/openevec"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/thediveo/enumflag"
)

func newVolumeCmd() *cobra.Command {
func newVolumeCmd(configName, verbosity *string) *cobra.Command {
cfg := &openevec.EdenSetupArgs{}
var volumeCmd = &cobra.Command{
Use: "volume",
Use: "volume",
PersistentPreRunE: preRunViperLoadFunction(cfg, configName, verbosity),
}

groups := CommandGroups{
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewEdenCommand() *cobra.Command {
newUtilsCmd(&configName, &verbosity),
newControllerCmd(&configName, &verbosity),
newNetworkCmd(),
newVolumeCmd(),
newVolumeCmd(&configName, &verbosity),
newDisksCmd(),
newPacketCmd(&configName, &verbosity),
newRolCmd(&configName, &verbosity),
Expand Down
3 changes: 1 addition & 2 deletions pkg/openevec/edenVolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/lf-edge/eve/api/go/config"
uuid "github.com/satori/go.uuid"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)

func (openEVEC *OpenEVEC) VolumeLs(outputFormat types.OutputFormat) error {
Expand Down Expand Up @@ -83,7 +82,7 @@ func (openEVEC *OpenEVEC) VolumeCreate(appLink, registry, diskSize, volumeName,
registryToUse := registry
switch registry {
case "local":
registryToUse = fmt.Sprintf("%s:%d", viper.GetString("registry.ip"), viper.GetInt("registry.port"))
registryToUse = fmt.Sprintf("%s:%d", openEVEC.cfg.Registry.IP, openEVEC.cfg.Registry.Port)
case "remote":
registryToUse = ""
}
Expand Down

0 comments on commit d4aeb04

Please sign in to comment.