diff --git a/pkg/modules/generators/app_configurations_generator.go b/pkg/modules/generators/app_configurations_generator.go index fb0a06b4..3c8f4a87 100644 --- a/pkg/modules/generators/app_configurations_generator.go +++ b/pkg/modules/generators/app_configurations_generator.go @@ -134,7 +134,7 @@ func (g *appConfigurationGenerator) Generate(spec *v1.Spec) error { // patch workload with resource patchers for _, p := range patchers { - if err = patchWorkload(&wl, &p); err != nil { + if err = PatchWorkload(&wl, &p); err != nil { return err } } @@ -152,7 +152,7 @@ func (g *appConfigurationGenerator) Generate(spec *v1.Spec) error { return nil } -func patchWorkload(workload *v1.Resource, patcher *internalv1.Patcher) error { +func PatchWorkload(workload *v1.Resource, patcher *internalv1.Patcher) error { if patcher == nil { return nil } diff --git a/pkg/modules/generators/app_configurations_generator_test.go b/pkg/modules/generators/app_configurations_generator_test.go index 4bf8fac7..95074a74 100644 --- a/pkg/modules/generators/app_configurations_generator_test.go +++ b/pkg/modules/generators/app_configurations_generator_test.go @@ -288,7 +288,7 @@ func Test_patchWorkload(t *testing.T) { Annotations: map[string]string{"newAnnotation": "newValue"}, } - err := patchWorkload(res, patcher) + err := PatchWorkload(res, patcher) assert.NoError(t, err) workloadLabels := res.Attributes["metadata"].(map[string]interface{})["labels"].(map[string]interface{}) @@ -321,7 +321,7 @@ func Test_patchWorkload(t *testing.T) { }, } - err = patchWorkload(res, patcher) + err = PatchWorkload(res, patcher) assert.NoError(t, err) containers := res.Attributes["spec"].(map[string]interface{})["template"].(map[string]interface{})["spec"].(map[string]interface{})["containers"].([]interface{}) diff --git a/pkg/modules/plugin.go b/pkg/modules/plugin.go index bf03042d..927422a6 100644 --- a/pkg/modules/plugin.go +++ b/pkg/modules/plugin.go @@ -75,7 +75,7 @@ func (p *Plugin) initModule() error { return err } pluginName := prefix[0] + "-" + prefix[1] - client, err := newPluginClient(pluginPath, pluginName) + client, err := NewPluginClient(pluginPath, pluginName) if err != nil { return err } @@ -122,7 +122,7 @@ func buildPluginPath(namespace, resourceType, version string) (string, error) { return p, nil } -func newPluginClient(modulePluginPath, moduleName string) (*plugin.Client, error) { +func NewPluginClient(modulePluginPath, moduleName string) (*plugin.Client, error) { // create the plugin log file var logFilePath string dir, err := kfile.KusionDataFolder()