Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Remove shadow verbose flag. (#147)
Browse files Browse the repository at this point in the history
Fixes #146
  • Loading branch information
Mark Emeis committed Mar 9, 2020
1 parent 493881b commit 7912852
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd/wksctl/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"path/filepath"

"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/weaveworks/wksctl/pkg/addons"
"github.com/weaveworks/wksctl/pkg/apis/wksprovider/machine/config"
Expand Down Expand Up @@ -37,7 +38,6 @@ type Params struct {
configDirectory string
namespace string
useManifestNamespace bool
verbose bool
}

var globalParams Params
Expand All @@ -56,9 +56,6 @@ func init() {
Cmd.Flags().StringVar(&globalParams.namespace, "namespace", manifest.DefaultNamespace, "namespace override for WKS components")
Cmd.Flags().BoolVar(&globalParams.useManifestNamespace, "use-manifest-namespace", false, "use namespaces from supplied manifests (overriding any --namespace argument)")

// Intentionally shadows the globally defined --verbose flag.
Cmd.Flags().BoolVarP(&globalParams.verbose, "verbose", "v", false, "Enable verbose output")

// Hide controller-image flag as it is a helper/debug flag.
Cmd.Flags().StringVar(&globalParams.controllerImage, "controller-image", "", "Controller image override")
Cmd.Flags().MarkHidden("controller-image")
Expand Down Expand Up @@ -97,7 +94,7 @@ func (a *Applier) Apply() error {

func (a *Applier) initiateCluster(clusterManifestPath, machinesManifestPath string) error {
sp := specs.NewFromPaths(clusterManifestPath, machinesManifestPath)
sshClient, err := ssh.NewClientForMachine(sp.MasterSpec, sp.ClusterSpec.User, a.Params.sshKeyPath, a.Params.verbose)
sshClient, err := ssh.NewClientForMachine(sp.MasterSpec, sp.ClusterSpec.User, a.Params.sshKeyPath, log.GetLevel() > log.InfoLevel)

if err != nil {
return errors.Wrap(err, "failed to create SSH client")
Expand Down

0 comments on commit 7912852

Please sign in to comment.