review: make splitAndDeannotate private

Signed-off-by: Carlos Lima <carlos@cpan.org>
pull/13154/head
Carlos Lima 3 months ago
parent 855b5a44b7
commit b26b473bf6

@ -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)
}
}

@ -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

Loading…
Cancel
Save