diff --git a/go.mod b/go.mod index 54e6675..04d9754 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.9 // indirect github.com/linuxsuren/cobra-extension v0.0.10 - github.com/linuxsuren/go-cli-alias v0.0.5 + github.com/linuxsuren/go-cli-alias v0.0.6 github.com/mitchellh/copystructure v1.1.1 // indirect github.com/spf13/cobra v1.1.1 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 3d71e98..a4b585a 100644 --- a/go.sum +++ b/go.sum @@ -264,8 +264,8 @@ github.com/linuxsuren/cobra-extension v0.0.6 h1:JlSmHjE/KCdJBZYGTjQbgvXSpziFwzpI github.com/linuxsuren/cobra-extension v0.0.6/go.mod h1:qcEJv7BbL0UpK6MbrTESP/nKf1+z1wQdMAnE1NBl3QQ= github.com/linuxsuren/cobra-extension v0.0.10 h1:ciZDb2Bp/aAFqr4YoeVuH2uyBaBFfO6pwz1WBih7R4A= github.com/linuxsuren/cobra-extension v0.0.10/go.mod h1:nDsXgvm0lSWVV+byAEfwhIGFDoIp0Sq9wkfNUDBp5do= -github.com/linuxsuren/go-cli-alias v0.0.5 h1:8FuE+z9Gvp6UIxV5ojl+RQ+UazoxGR92OWwrs9z0+RM= -github.com/linuxsuren/go-cli-alias v0.0.5/go.mod h1:Sa7xNUI72BgHTcywDU8MXVSH1q72SLdMALZSSANwuUM= +github.com/linuxsuren/go-cli-alias v0.0.6 h1:PGYf1xqy5GzGINeRhiZR1PTlp09cbyC66MGcXp+iC1Q= +github.com/linuxsuren/go-cli-alias v0.0.6/go.mod h1:Sa7xNUI72BgHTcywDU8MXVSH1q72SLdMALZSSANwuUM= github.com/linuxsuren/http-downloader v0.0.2-0.20201207132639-19888a6beaec h1:N6xw+W4IvgOV0cmhE7iUWKHNZqMUXlT3in+1ORmqIGo= github.com/linuxsuren/http-downloader v0.0.2-0.20201207132639-19888a6beaec/go.mod h1:zRZY9FCDBuYNDxbI2Ny5suasZsMk7J6q9ecQ3V3PIqI= github.com/linuxsuren/http-downloader v0.0.6 h1:JuCgWVT4/pw8MAhYe+ngE7BwcO575L1aPDc9Fgx+2ig= diff --git a/kubectl-plugin/pipeline/create.go b/kubectl-plugin/pipeline/create.go index 5aeb3b5..c8875aa 100644 --- a/kubectl-plugin/pipeline/create.go +++ b/kubectl-plugin/pipeline/create.go @@ -113,9 +113,6 @@ func (o *pipelineCreateOption) runE(cmd *cobra.Command, args []string) (err erro err = fmt.Errorf("failed to create Pipeline, %v", err) } } - if err != nil { - fmt.Println(err) - } return } @@ -209,22 +206,20 @@ func (o *pipelineCreateOption) createPipelineObj() (rawPip *unstructured.Unstruc funcMap := sprig.FuncMap() //funcMap["raw"] = html.UnescapeString funcMap["raw"] = func(text string) template.HTML { + /* #nosec */ return template.HTML(text) } if tpl, err = template.New("pipeline").Funcs(funcMap).Parse(pipelineTemplate); err != nil { err = fmt.Errorf("failed to parse Pipeline template, %v", err) - fmt.Println(err) return } var buf bytes.Buffer if err = tpl.Execute(&buf, o); err != nil { err = fmt.Errorf("failed to render Pipeline template, %v", err) - fmt.Println(err) return } - fmt.Println(buf.String()) if rawPip, err = types.GetObjectFromYaml(buf.String()); err != nil { err = fmt.Errorf("failed to unmarshal yaml to Pipeline object, %v", err) }