MCPcopy Index your code
hub / github.com/databus23/helm-diff / normalizeContent

Function normalizeContent

manifest/parse.go:219–232  ·  view source on GitHub ↗
(content []byte)

Source from the content-addressed store, hash-verified

217}
218
219func normalizeContent(content []byte) ([]byte, error) {
220 // Unmarshal and marshal again content to normalize yaml structure
221 // This avoids style differences to show up as diffs but it can
222 // make the output different from the original template (since it is in normalized form)
223 var object map[interface{}]interface{}
224 if err := yaml.Unmarshal(content, &object); err != nil {
225 return nil, err
226 }
227 normalizedContent, err := yaml.Marshal(object)
228 if err != nil {
229 return nil, err
230 }
231 return normalizedContent, nil
232}
233
234func isHook(metadata metadata, hooks ...string) bool {
235 for _, hook := range hooks {

Callers 2

parseContentFunction · 0.85
TestNormalizeContentFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestNormalizeContentFunction · 0.68