mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-07-14 07:24:43 +00:00
set indentation if ToYAML func
This commit is contained in:
parent
e8045d1a82
commit
146334455a
@ -46,7 +46,9 @@ func (k *Kubeconfig) WithCtxs(c ...*Context) *Kubeconfig { (*k)["contexts
|
||||
func (k *Kubeconfig) ToYAML(t *testing.T) string {
|
||||
t.Helper()
|
||||
var v strings.Builder
|
||||
if err := yaml.NewEncoder(&v).Encode(*k); err != nil {
|
||||
enc := yaml.NewEncoder(&v)
|
||||
enc.SetIndent(0)
|
||||
if err := enc.Encode(*k); err != nil {
|
||||
t.Fatalf("failed to encode mock kubeconfig: %v", err)
|
||||
}
|
||||
return v.String()
|
||||
|
Loading…
Reference in New Issue
Block a user