From d9f2a41e5a7303a25d9fba5bc2670f3a01e923de Mon Sep 17 00:00:00 2001 From: jlamillan Date: Fri, 5 Apr 2019 12:38:25 -0700 Subject: [PATCH] Prepend 3 dashes at the beginning of addon YAMLs if missing. Resolves #1251. --- cluster/addons.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cluster/addons.go b/cluster/addons.go index 1af01359..a203cf76 100644 --- a/cluster/addons.go +++ b/cluster/addons.go @@ -160,6 +160,13 @@ func (c *Cluster) deployAddonsInclude(ctx context.Context) error { if err := validateUserAddonYAML(addonYAML); err != nil { return err } + + // Put 3 dashes (---) at beginning of next YAML if it is not there already so we can append to manifests + dashes := "---\n" + if !strings.HasPrefix(string(addonYAML[:]), dashes) { + addonYAML = append([]byte(dashes), addonYAML...) + } + manifests = append(manifests, addonYAML...) } else if isFilePath(addon) { addonYAML, err := ioutil.ReadFile(addon)