From b26b473bf6c4755e1b1d6ba9c63a3f2c73dfaa74 Mon Sep 17 00:00:00 2001 From: Carlos Lima Date: Sun, 15 Jun 2025 19:03:51 +0800 Subject: [PATCH] review: make splitAndDeannotate private Signed-off-by: Carlos Lima --- pkg/action/action.go | 6 +++--- pkg/action/action_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/action/action.go b/pkg/action/action.go index 4c02031fa..643dddc45 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -128,9 +128,9 @@ func annotateAndMerge(files map[string]string) (string, error) { return merged, nil } -// SplitAndDeannotate reconstructs individual files from a merged YAML stream, +// splitAndDeannotate reconstructs individual files from a merged YAML stream, // removing filename annotations and grouping documents by their original filenames. -func SplitAndDeannotate(postrendered string) (map[string]string, error) { +func splitAndDeannotate(postrendered string) (map[string]string, error) { manifests, err := kio.ParseAll(postrendered) if err != nil { return nil, fmt.Errorf("re-parsing merged buffer: %w", err) @@ -253,7 +253,7 @@ func (cfg *Configuration) renderResources(ch *chart.Chart, values chartutil.Valu } // Use the file list and contents received from the post renderer - if files, err = SplitAndDeannotate(postRendered.String()); err != nil { + if files, err = splitAndDeannotate(postRendered.String()); err != nil { return hs, b, notes, fmt.Errorf("error while parsing post rendered files: %w", err) } } diff --git a/pkg/action/action_test.go b/pkg/action/action_test.go index c55b726ea..401451a42 100644 --- a/pkg/action/action_test.go +++ b/pkg/action/action_test.go @@ -699,7 +699,7 @@ data: for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - files, err := SplitAndDeannotate(tt.input) + files, err := splitAndDeannotate(tt.input) if tt.expectedError != "" { assert.Error(t, err) @@ -753,7 +753,7 @@ data: require.NoError(t, err) // Split and deannotate - reconstructed, err := SplitAndDeannotate(merged) + reconstructed, err := splitAndDeannotate(merged) require.NoError(t, err) // Compare the results