MCPcopy
hub / github.com/zegl/kube-score / decode

Method decode

parser/parse.go:226–233  ·  view source on GitHub ↗
(data []byte, object runtime.Object)

Source from the content-addressed store, hash-verified

224}
225
226func (p *Parser) decode(data []byte, object runtime.Object) error {
227 deserializer := p.codecs.UniversalDeserializer()
228 if _, _, err := deserializer.Decode(data, nil, object); err != nil {
229 gvk := object.GetObjectKind().GroupVersionKind()
230 return fmt.Errorf("Failed to parse %s: err=%w", gvk, err)
231 }
232 return nil
233}
234
235func detectFileLocation(fileName string, fileOffset int, fileContents []byte) ks.FileLocation {
236 // If the object YAML begins with a Helm style "# Source: " comment

Callers 4

detectAndDecodeMethod · 0.95
decodeItemMethod · 0.95
writeSyncFunction · 0.80
loadStringMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected