MCPcopy
hub / github.com/vmware-tanzu/sonobuoy / dumpPlugin

Function dumpPlugin

pkg/discovery/discovery.go:305–317  ·  view source on GitHub ↗

dumpPlugin will marshal the plugin to the appropriate location in the outputDir: plugins/ /definition.json. This makes the data more clear for any consumer looking at the tarball about what was.

(p plugin.Interface, outputDir string)

Source from the content-addressed store, hash-verified

303// plugins/<name>/definition.json. This makes the data more clear for any consumer
304// looking at the tarball about what was.
305func dumpPlugin(p plugin.Interface, outputDir string) error {
306 b, err := json.Marshal(p)
307 if err != nil {
308 return errors.Wrapf(err, "encoding plugin %v definition to yaml", p.GetName())
309 }
310
311 err = os.WriteFile(
312 filepath.Join(outputDir, results.PluginsDir, p.GetName(), pluginDefinitionFilename),
313 b,
314 os.FileMode(0644),
315 )
316 return errors.Wrapf(err, "writing plugin %v definition to yaml", p.GetName())
317}
318
319// updateStatus changes the summary status of the sonobuoy pod in order to
320// effect the finalized status the user sees. This does not change the

Callers 1

RunFunction · 0.85

Calls 1

GetNameMethod · 0.65

Tested by

no test coverage detected