Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfcnunes committed Dec 15, 2023
1 parent 282c842 commit 6a27db0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions pkg/providers/k8s/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func Test_getObject(t *testing.T) {
}
}

func Test_getKubeConfig(t *testing.T) {
func Test_getKubeConfigPath(t *testing.T) {
homeDir, _ := os.UserHomeDir()
testcases := []struct {
config config.MapConfig
Expand Down Expand Up @@ -146,7 +146,7 @@ func Test_getKubeConfig(t *testing.T) {
if tc.kubeConfigEnvVar != "" {
os.Setenv("KUBECONFIG", tc.kubeConfigEnvVar)
}
got, err := getKubeConfig(tc.config)
got, err := getKubeConfigPath(tc.config)
if err != nil {
if err.Error() != tc.wantErr {
t.Fatalf("unexpected error: want %q, got %q", tc.wantErr, err.Error())
Expand Down Expand Up @@ -190,7 +190,10 @@ func Test_getKubeContext(t *testing.T) {
for i := range testcases {
tc := testcases[i]
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
got := getKubeContext(tc.config)
got, err := getKubeContext(tc.config)
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
if diff := cmp.Diff(tc.want, got); diff != "" {
t.Errorf("unexpected result: -(want), +(got)\n%s", diff)
}
Expand Down Expand Up @@ -261,7 +264,7 @@ func Test_GetString(t *testing.T) {
conf := map[string]interface{}{}
conf["kubeConfigPath"] = fmt.Sprintf("%s/.kube/config", homeDir)
conf["kubeContext"] = "minikube"
p, _ := New(logger, config.MapConfig{M: conf})
p := New(logger, config.MapConfig{M: conf})

got, err := p.GetString(tc.path)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion vals.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (r *Runtime) prepare() (*expansion.ExpandRegexMatch, error) {
return p, nil
case ProviderK8s:
p := k8s.New(r.logger, conf)
return p, nil
return p, nil
}
return nil, fmt.Errorf("no provider registered for scheme %q", scheme)
}
Expand Down

0 comments on commit 6a27db0

Please sign in to comment.