From 1801fa0074a0207f4d5724667858b53d52c486f8 Mon Sep 17 00:00:00 2001 From: adshmh <23505281+adshmh@users.noreply.github.com> Date: Tue, 6 Nov 2018 19:08:24 -0500 Subject: [PATCH] fix(helm): fix incorrect yaml output format of get hooks command (#4684) Signed-off-by: Arash Deshmeh --- cmd/helm/get_hooks.go | 2 +- cmd/helm/get_hooks_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/helm/get_hooks.go b/cmd/helm/get_hooks.go index 310b2ec73..2706f381c 100644 --- a/cmd/helm/get_hooks.go +++ b/cmd/helm/get_hooks.go @@ -75,7 +75,7 @@ func (g *getHooksCmd) run() error { } for _, hook := range res.Release.Hooks { - fmt.Fprintf(g.out, "---\n# %s\n%s", hook.Name, hook.Manifest) + fmt.Fprintf(g.out, "---\n# %s\n%s\n", hook.Name, hook.Manifest) } return nil } diff --git a/cmd/helm/get_hooks_test.go b/cmd/helm/get_hooks_test.go index fe9133feb..94aace4df 100644 --- a/cmd/helm/get_hooks_test.go +++ b/cmd/helm/get_hooks_test.go @@ -17,6 +17,7 @@ limitations under the License. package main import ( + "fmt" "io" "testing" @@ -31,7 +32,7 @@ func TestGetHooks(t *testing.T) { { name: "get hooks with release", args: []string{"aeneas"}, - expected: helm.MockHookTemplate, + expected: fmt.Sprintf("---\n# %s\n%s\n", "pre-install-hook", helm.MockHookTemplate), resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "aeneas"}), rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "aeneas"})}, },