From 9bf6ae62ac76ab68596119511e18523b30152bd7 Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Fri, 21 Sep 2018 14:48:24 -0400 Subject: [PATCH] fix(helm): fix incorrect yaml output format of get hooks command 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"})}, },