-
Notifications
You must be signed in to change notification settings - Fork 87
Add MCP Inspector plugin backend #2206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -225,6 +225,7 @@ type BootOptionsBuilder struct { | |||||||||||||||||||||||||||
| isCertManagerInstalled bool | ||||||||||||||||||||||||||||
| isConsolePluginInstalled bool | ||||||||||||||||||||||||||||
| isClusterVersionInstalled bool | ||||||||||||||||||||||||||||
| consolePluginImageOverride string | ||||||||||||||||||||||||||||
| isDNSOperatorInstalled bool | ||||||||||||||||||||||||||||
| isLimitadorOperatorInstalled bool | ||||||||||||||||||||||||||||
| isAuthorinoOperatorInstalled bool | ||||||||||||||||||||||||||||
|
|
@@ -469,7 +470,9 @@ func (b *BootOptionsBuilder) getConsolePluginOptions() ([]controller.ControllerO | |||||||||||||||||||||||||||
| return nil, err | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| if !b.isConsolePluginInstalled || !b.isClusterVersionInstalled { | ||||||||||||||||||||||||||||
| b.consolePluginImageOverride = env.GetString(openshift.ConsolePluginImageOverrideEnvVar, "") | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| if !b.isConsolePluginInstalled || (!b.isClusterVersionInstalled && b.consolePluginImageOverride == "") { | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Keep cleanup reconciliation active after an image override is removed. If an operator removes
Proposed fix- if !b.isConsolePluginInstalled || (!b.isClusterVersionInstalled && b.consolePluginImageOverride == "") {
+ if !b.isConsolePluginInstalled {
b.logger.Info("console plugin or openshift cluster version is not installed, skipping related watches and reconcilers")
return opts, nil
}
- if b.isConsolePluginInstalled && (b.isClusterVersionInstalled || b.consolePluginImageOverride != "") {
+ if b.isConsolePluginInstalled {
mainWorkflow.Tasks = append(mainWorkflow.Tasks,
traceReconcileFunc("workflow.console_plugin", NewConsolePluginReconciler(
b.manager, operatorNamespace, b.consolePluginImageOverride,
).Subscription().Reconcile),
)
}📝 Committable suggestion
Suggested change
Suggested change
📍 Affects 1 file
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| b.logger.Info("console plugin or openshift cluster version is not installed, skipping related watches and reconcilers") | ||||||||||||||||||||||||||||
| return opts, nil | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
@@ -478,13 +481,15 @@ func (b *BootOptionsBuilder) getConsolePluginOptions() ([]controller.ControllerO | |||||||||||||||||||||||||||
| controller.WithRunnable("consoleplugin watcher", controller.Watch( | ||||||||||||||||||||||||||||
| &consolev1.ConsolePlugin{}, openshift.ConsolePluginsResource, metav1.NamespaceAll, | ||||||||||||||||||||||||||||
| controller.FilterResourcesByLabel[*consolev1.ConsolePlugin](fmt.Sprintf("%s=%s", consoleplugin.AppLabelKey, consoleplugin.AppLabelValue)))), | ||||||||||||||||||||||||||||
| controller.WithRunnable("cluster version watcher", controller.Watch( | ||||||||||||||||||||||||||||
| controller.WithObjectKinds(openshift.ConsolePluginGVK.GroupKind()), | ||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||
| if b.isClusterVersionInstalled { | ||||||||||||||||||||||||||||
| opts = append(opts, controller.WithRunnable("cluster version watcher", controller.Watch( | ||||||||||||||||||||||||||||
| &configv1.ClusterVersion{}, | ||||||||||||||||||||||||||||
| openshift.ClusterVersionResource, | ||||||||||||||||||||||||||||
| metav1.NamespaceAll, | ||||||||||||||||||||||||||||
| )), | ||||||||||||||||||||||||||||
| controller.WithObjectKinds(openshift.ConsolePluginGVK.GroupKind(), openshift.ClusterVersionGroupKind.GroupKind()), | ||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||
| )), controller.WithObjectKinds(openshift.ClusterVersionGroupKind.GroupKind())) | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| return opts, nil | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
@@ -793,9 +798,9 @@ func (b *BootOptionsBuilder) Reconciler() controller.ReconcileFunc { | |||||||||||||||||||||||||||
| Postcondition: traceReconcileFunc("workflow.finalize", b.finalStepsWorkflow().Run), | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| if b.isConsolePluginInstalled && b.isClusterVersionInstalled { | ||||||||||||||||||||||||||||
| if b.isConsolePluginInstalled && (b.isClusterVersionInstalled || b.consolePluginImageOverride != "") { | ||||||||||||||||||||||||||||
| mainWorkflow.Tasks = append(mainWorkflow.Tasks, | ||||||||||||||||||||||||||||
| traceReconcileFunc("workflow.console_plugin", NewConsolePluginReconciler(b.manager, operatorNamespace).Subscription().Reconcile), | ||||||||||||||||||||||||||||
| traceReconcileFunc("workflow.console_plugin", NewConsolePluginReconciler(b.manager, operatorNamespace, b.consolePluginImageOverride).Subscription().Reconcile), | ||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift
Use the required workflow structure.
Line 129 adds another inline reconciliation operation to
Run. RefactorConsolePluginReconcilerto declare preconditions, tasks, and postconditions instead of extending direct serial reconciliation.As per coding guidelines,
internal/controller/*_reconciler.go: Implement reconcilers following the workflow pattern with preconditions, tasks, and postconditions.🤖 Prompt for AI Agents
Source: Coding guidelines