containerd / nri

Node Resource Interface
Apache License 2.0
257 stars 65 forks source link

Merge PluginError into Result #5

Closed ddebroy closed 3 years ago

ddebroy commented 3 years ago

Merge the PluginError struct into Result. This allows the NRI skeleton and invocation to encode and un-marshal to a single type and cleans up the code a bit.

Error messages from injected errors:

nri invoke: plugin: testplugin: injected structured error
nri invoke: plugin: testplugin: failed to unmarshal plugin output: unexpected end of JSON input: output: <empty> exit code: 1
nri invoke: plugin: testplugin: failed to unmarshal plugin output: invalid character 'i' looking for beginning of value: output: "injected invalid output"
nri invoke: plugin: testplugin: exec: "missing": executable file not found in $PATH

Signed-off-by: Deep Debroy ddebroy@apple.com