From cb75a7383b88bb225ad6832e052cb3a58483c4b5 Mon Sep 17 00:00:00 2001 From: Eoin McAfee Date: Tue, 1 Jun 2021 14:14:23 +0100 Subject: [PATCH] revert back starlark converter name --- cmd/drone-server/inject_plugin.go | 2 +- plugin/converter/starlark.go | 4 ++-- plugin/converter/starlark_test.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/drone-server/inject_plugin.go b/cmd/drone-server/inject_plugin.go index 69c12122..f982a622 100644 --- a/cmd/drone-server/inject_plugin.go +++ b/cmd/drone-server/inject_plugin.go @@ -79,7 +79,7 @@ func provideConfigPlugin(client *scm.Client, contents core.FileService, conf spe func provideConvertPlugin(client *scm.Client, conf spec.Config, templateStore core.TemplateStore) core.ConvertService { return converter.Combine( converter.Legacy(false), - converter.New( + converter.Starlark( conf.Starlark.Enabled, ), converter.Jsonnet( diff --git a/plugin/converter/starlark.go b/plugin/converter/starlark.go index 86cca43c..ee6bcc3e 100644 --- a/plugin/converter/starlark.go +++ b/plugin/converter/starlark.go @@ -22,9 +22,9 @@ import ( "github.com/drone/drone/plugin/converter/starlark" ) -// New returns a conversion service that converts the +// Starlark returns a conversion service that converts the // starlark file to a yaml file. -func New(enabled bool) core.ConvertService { +func Starlark(enabled bool) core.ConvertService { return &starlarkPlugin{ enabled: enabled, } diff --git a/plugin/converter/starlark_test.go b/plugin/converter/starlark_test.go index faf31312..97310b9f 100644 --- a/plugin/converter/starlark_test.go +++ b/plugin/converter/starlark_test.go @@ -22,7 +22,7 @@ import ( ) func TestStarlarkConvert(t *testing.T) { - plugin := New(true) + plugin := Starlark(true) req := &core.ConvertArgs{ Build: &core.Build{ @@ -100,7 +100,7 @@ func TestConvert_Multi(t *testing.T) { }, } - plugin := New(true) + plugin := Starlark(true) config, err := plugin.Convert(noContext, req) if err != nil { t.Error(err) @@ -125,7 +125,7 @@ func TestConvert_Multi(t *testing.T) { // this test verifies the plugin is skipped when it has // not been explicitly enabled. func TestConvert_Skip(t *testing.T) { - plugin := New(false) + plugin := Starlark(false) config, err := plugin.Convert(noContext, nil) if err != nil { t.Error(err) @@ -145,7 +145,7 @@ func TestConvert_SkipYaml(t *testing.T) { }, } - plugin := New(true) + plugin := Starlark(true) config, err := plugin.Convert(noContext, req) if err != nil { t.Error(err)