Skip to content

Commit

Permalink
clean up issue with exported constant used in test, fmt'd/linted
Browse files Browse the repository at this point in the history
  • Loading branch information
jm96441n committed Feb 2, 2023
1 parent cc59a12 commit 759f50e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions cli/cmd/proxy/loglevel/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ import (
"strings"
"sync"

"github.com/hashicorp/consul-k8s/cli/common"
"github.com/hashicorp/consul-k8s/cli/common/envoy"
"github.com/hashicorp/consul-k8s/cli/common/flag"
"github.com/hashicorp/consul-k8s/cli/common/terminal"
"github.com/posener/complete"
helmCLI "helm.sh/helm/v3/pkg/cli"
"k8s.io/apimachinery/pkg/api/validation"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"

"github.com/hashicorp/consul-k8s/cli/common"
"github.com/hashicorp/consul-k8s/cli/common/envoy"
"github.com/hashicorp/consul-k8s/cli/common/flag"
"github.com/hashicorp/consul-k8s/cli/common/terminal"
)

const (
Expand Down Expand Up @@ -172,7 +173,7 @@ func (l *LogLevelCommand) parseFlags(args []string) error {
}

func (l *LogLevelCommand) validateFlags() error {
if l.level != "" && l.reset == true {
if l.level != "" && l.reset {
return fmt.Errorf("cannot set log level to %q and reset to 'info' at the same time", l.level)
}
if l.namespace == "" {
Expand Down
7 changes: 4 additions & 3 deletions cli/cmd/proxy/loglevel/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
"regexp"
"testing"

"github.com/hashicorp/consul-k8s/cli/common"
"github.com/hashicorp/consul-k8s/cli/common/envoy"
"github.com/hashicorp/consul-k8s/cli/common/terminal"
"github.com/hashicorp/go-hclog"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/fake"

"github.com/hashicorp/consul-k8s/cli/common"
"github.com/hashicorp/consul-k8s/cli/common/envoy"
"github.com/hashicorp/consul-k8s/cli/common/terminal"
)

func TestFlagParsingFails(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions cli/common/envoy/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ func (m *mockPortForwarder) Open(ctx context.Context) (string, error) { return m
func (m *mockPortForwarder) Close() {}

func testLogConfig() map[string]string {
cfg := make(map[string]string, len(envoyLoggers))
for k := range envoyLoggers {
cfg := make(map[string]string, len(EnvoyLoggers))
for k := range EnvoyLoggers {
cfg[k] = "debug"
}
return cfg
Expand Down

0 comments on commit 759f50e

Please sign in to comment.