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)
| 303 | // plugins/<name>/definition.json. This makes the data more clear for any consumer |
| 304 | // looking at the tarball about what was. |
| 305 | func 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 |