Skip to content

Commit

Permalink
Bump go-cli-alias from v0.0.5 to v0.0.6 (#67)
Browse files Browse the repository at this point in the history
* Bump go-cli-alias from v0.0.5 to v0.0.6

* Ignore gosec error about template.HTML as a temporary solution
  • Loading branch information
LinuxSuRen committed Mar 8, 2021
1 parent 8a0cc13 commit 68364c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
7 changes: 1 addition & 6 deletions kubectl-plugin/pipeline/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 68364c6

Please sign in to comment.