Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Anuj Chaudhari <[email protected]>
  • Loading branch information
anujc25 committed Jan 4, 2025
1 parent 6e8a309 commit 24a6ec1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/auth/utils/kubeconfig/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func MergeKubeConfigWithoutSwitchContext(kubeConfig []byte, mergeFile string) er
}

context := dest.CurrentContext
err = mergo.Merge(dest, newConfig, mergo.WithOverwriteWithEmptyValue)
err = mergo.Merge(dest, newConfig)

if err != nil {
return errors.Wrap(err, "failed to merge config")
Expand Down
1 change: 1 addition & 0 deletions pkg/command/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ func TestGlobalInit(t *testing.T) {
assert.NotContains(string(got), initString)
assert.NotContains(string(got), "The initialization encountered an error")
}
globalinit.ResetInitializers()
})
}
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/globalinit/global_initializers.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ func PerformInitializations(outStream io.Writer) error {

return kerrors.NewAggregate(errorList)
}

func ResetInitializers() {
initializers = []initializer{}
}

0 comments on commit 24a6ec1

Please sign in to comment.