| 19 | } |
| 20 | |
| 21 | func newTaskPluginSubmitDiagnostics(c *gin.Context) taskPluginSubmitDiagnostics { |
| 22 | diagnostics := taskPluginSubmitDiagnostics{ |
| 23 | context: c, |
| 24 | pluginKey: c.GetString("expected_task_plugin_key"), |
| 25 | } |
| 26 | if diagnostics.pluginKey == "" { |
| 27 | return diagnostics |
| 28 | } |
| 29 | if pinnedValue, exists := c.Get(pluginruntime.ContextKeyPinnedPlugin); exists { |
| 30 | if pinned, ok := pinnedValue.(pluginruntime.PinnedPlugin); ok && pinned.Generation != nil { |
| 31 | diagnostics.generation = pinned.Generation.Number |
| 32 | } |
| 33 | } |
| 34 | return diagnostics |
| 35 | } |
| 36 | |
| 37 | func (d taskPluginSubmitDiagnostics) start(info *relaycommon.RelayInfo) { |
| 38 | if d.pluginKey == "" { |