diff --git a/cmd/pluralctl/main.go b/cmd/pluralctl/main.go index 54438e3e..9bee1fea 100644 --- a/cmd/pluralctl/main.go +++ b/cmd/pluralctl/main.go @@ -7,6 +7,9 @@ import ( "github.com/pluralsh/plural-cli/cmd/command/cd" "github.com/fatih/color" + "github.com/urfave/cli" + "helm.sh/helm/v3/pkg/action" + "github.com/pluralsh/plural-cli/cmd/command/clone" cryptocmd "github.com/pluralsh/plural-cli/cmd/command/crypto" "github.com/pluralsh/plural-cli/cmd/command/down" @@ -20,8 +23,6 @@ import ( conf "github.com/pluralsh/plural-cli/pkg/config" "github.com/pluralsh/plural-cli/pkg/crypto" "github.com/pluralsh/plural-cli/pkg/utils" - "github.com/urfave/cli" - "helm.sh/helm/v3/pkg/action" ) const ApplicationName = "pluralctl" @@ -69,7 +70,7 @@ func main() { cd.Command(plural.Plural, plural.HelmConfiguration), up.Command(plural.Plural), down.Command(), - pr.Command(), + pr.Command(plural.Plural), cmdinit.Command(plural.Plural), mgmt.Command(plural.Plural), profile.Command(), diff --git a/go.mod b/go.mod index 1581ad8d..62a80da0 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,6 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/norwoodj/helm-docs v1.11.2 github.com/olekukonko/tablewriter v0.0.5 - github.com/osteele/liquid v1.4.0 github.com/packethost/packngo v0.29.0 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/pluralsh/cluster-api-migration v0.2.16 @@ -227,6 +226,7 @@ require ( github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect github.com/onsi/gomega v1.32.0 // indirect github.com/orcaman/concurrent-map v1.0.0 // indirect + github.com/osteele/liquid v1.4.0 // indirect github.com/osteele/tuesday v1.0.3 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect diff --git a/pkg/cd/control_plane_install.go b/pkg/cd/control_plane_install.go index 9cc9cd63..3d49cb81 100644 --- a/pkg/cd/control_plane_install.go +++ b/pkg/cd/control_plane_install.go @@ -10,7 +10,8 @@ import ( "gopkg.in/yaml.v3" "github.com/AlecAivazis/survey/v2" - "github.com/osteele/liquid" + pollytemplate "github.com/pluralsh/polly/template" + "github.com/pluralsh/plural-cli/pkg/api" "github.com/pluralsh/plural-cli/pkg/bundle" "github.com/pluralsh/plural-cli/pkg/config" @@ -22,10 +23,6 @@ import ( "github.com/pluralsh/plural-cli/pkg/utils/git" ) -var ( - liquidEngine = liquid.NewEngine() -) - const ( templateUrl = "https://raw.githubusercontent.com/pluralsh/console/master/templates/values.yaml.liquid" tplUrl = "https://raw.githubusercontent.com/pluralsh/console/master/templates/values.yaml.tpl" @@ -241,7 +238,7 @@ func CreateControlPlane(conf config.Config) (string, error) { "configuration": configuration, } - res, err := liquidEngine.ParseAndRender(tpl, bindings) + res, err := pollytemplate.RenderLiquid(tpl, bindings) return string(res), err } diff --git a/pkg/pr/utils.go b/pkg/pr/utils.go index 45560a86..8bca4849 100644 --- a/pkg/pr/utils.go +++ b/pkg/pr/utils.go @@ -4,18 +4,14 @@ import ( "os" "path/filepath" - "github.com/osteele/liquid" -) - -var ( - liquidEngine = liquid.NewEngine() + "github.com/pluralsh/polly/template" ) func templateReplacement(data []byte, ctx map[string]interface{}) ([]byte, error) { bindings := map[string]interface{}{ "context": ctx, } - return liquidEngine.ParseAndRender(data, bindings) + return template.RenderLiquid(data, bindings) } func replaceTo(from, to string, rep func(data []byte) ([]byte, error)) error {