File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,12 @@ func (f *WasmtimeFn) Run(r io.Reader, w io.Writer) error {
152
152
resultStr := fmt .Sprintf ("%s" , result )
153
153
resultStr = resultStr [2 : len (resultStr )- 1 ]
154
154
// Try to parse the output as yaml.
155
- if _ , err = yaml .Parse (resultStr ); err != nil {
156
- return errors .New (resultStr )
155
+ resourceListOutput , err := yaml .Parse (resultStr )
156
+ if err != nil {
157
+ return fmt .Errorf ("error parsing output resource list %q: %w" , resultStr , err )
158
+ }
159
+ if resourceListOutput .GetKind () != "ResourceList" {
160
+ return fmt .Errorf ("invalid resource list output from wasm library; got %q" , resultStr )
157
161
}
158
162
if _ , err = w .Write ([]byte (resultStr )); err != nil {
159
163
return fmt .Errorf ("unable to write the output resource list: %w" , err )
You can’t perform that action at this time.
0 commit comments