initPlugin is a simple wrapper that will try to validate the spec before actually passing it to Init.
(ctx context.Context, client plugin.PluginClient, spec map[string]any, noConnection bool, syncID string)
| 98 | |
| 99 | // initPlugin is a simple wrapper that will try to validate the spec before actually passing it to Init. |
| 100 | func initPlugin(ctx context.Context, client plugin.PluginClient, spec map[string]any, noConnection bool, syncID string) error { |
| 101 | specBytes, err := marshalSpec(spec) |
| 102 | if err != nil { |
| 103 | return err |
| 104 | } |
| 105 | |
| 106 | _, err = client.Init(ctx, &plugin.Init_Request{Spec: specBytes, NoConnection: noConnection, InvocationId: syncID}) |
| 107 | return err |
| 108 | } |
| 109 | |
| 110 | // validatePluginSpec encompasses spec validation against a plugin obtained |
| 111 | // over gRPC. Schema acquisition and validation are kept lenient so that a |
no test coverage detected