refactor: expose cluster provider strategy to toolsets#836
Closed
Cali0707 wants to merge 1 commit intocontainers:mainfrom
Closed
refactor: expose cluster provider strategy to toolsets#836Cali0707 wants to merge 1 commit intocontainers:mainfrom
Cali0707 wants to merge 1 commit intocontainers:mainfrom
Conversation
Signed-off-by: Calum Murray <cmurray@redhat.com>
Member
|
Can we hold on this one until I send a proposed alternative via Middleware, that OpenShift struct was something I wanted to get rid of, so making it bigger won't help 😅 |
Collaborator
Author
|
@manusa for sure, happy to look into different ways of approaching this |
Collaborator
Author
|
Marking as draft so it doesn't get accidentally merged early |
|
What's the status of this PR? If I understand it correctly, this blocks openshift#124 |
manusa
added a commit
to marcnuri-forks/kubernetes-mcp-server
that referenced
this pull request
Mar 12, 2026
Expose GetClusterProviderStrategy() to tool and prompt handlers at execution time via the new ConfigProvider interface. This allows toolsets to access the cluster provider strategy when invoked, rather than only at initialization through GetTools(). The approach is compatible with dynamic config reload — subsequent tool calls always see the current strategy value. Refs containers#836 Signed-off-by: Marc Nuri <marc@marcnuri.com>
manusa
added a commit
to marcnuri-forks/kubernetes-mcp-server
that referenced
this pull request
Mar 12, 2026
Expose GetClusterProviderStrategy() to tool and prompt handlers at execution time via the new ConfigProvider interface. This allows toolsets to access the cluster provider strategy when invoked, rather than only at initialization through GetTools(). The approach is compatible with dynamic config reload — subsequent tool calls always see the current strategy value. Refs containers#836 Signed-off-by: Marc Nuri <marc@marcnuri.com>
manusa
added a commit
to marcnuri-forks/kubernetes-mcp-server
that referenced
this pull request
Mar 13, 2026
Replace the ConfigProvider interface with the existing BaseConfig interface in ToolHandlerParams and PromptHandlerParams. This avoids duplicating GetClusterProviderStrategy() across two interfaces and reuses the already composed BaseConfig which includes ClusterProvider and ExtendedConfigProvider. Reverts changes to pkg/api/config.go and pkg/kiali/kiali.go since no new interface is needed. Refs containers#836 Signed-off-by: Marc Nuri <marc@marcnuri.com>
matzew
pushed a commit
that referenced
this pull request
Mar 13, 2026
* refactor(api): rename ExtendedConfigProvider to ConfigProvider Expose GetClusterProviderStrategy() to tool and prompt handlers at execution time via the new ConfigProvider interface. This allows toolsets to access the cluster provider strategy when invoked, rather than only at initialization through GetTools(). The approach is compatible with dynamic config reload — subsequent tool calls always see the current strategy value. Refs #836 Signed-off-by: Marc Nuri <marc@marcnuri.com> * refactor(api): expose BaseConfig to tool and prompt handlers Replace the ConfigProvider interface with the existing BaseConfig interface in ToolHandlerParams and PromptHandlerParams. This avoids duplicating GetClusterProviderStrategy() across two interfaces and reuses the already composed BaseConfig which includes ClusterProvider and ExtendedConfigProvider. Reverts changes to pkg/api/config.go and pkg/kiali/kiali.go since no new interface is needed. Refs #836 Signed-off-by: Marc Nuri <marc@marcnuri.com> --------- Signed-off-by: Marc Nuri <marc@marcnuri.com>
matzew
pushed a commit
to matzew/kubernetes-mcp-server
that referenced
this pull request
Mar 13, 2026
…ers#916) * refactor(api): rename ExtendedConfigProvider to ConfigProvider Expose GetClusterProviderStrategy() to tool and prompt handlers at execution time via the new ConfigProvider interface. This allows toolsets to access the cluster provider strategy when invoked, rather than only at initialization through GetTools(). The approach is compatible with dynamic config reload — subsequent tool calls always see the current strategy value. Refs containers#836 Signed-off-by: Marc Nuri <marc@marcnuri.com> * refactor(api): expose BaseConfig to tool and prompt handlers Replace the ConfigProvider interface with the existing BaseConfig interface in ToolHandlerParams and PromptHandlerParams. This avoids duplicating GetClusterProviderStrategy() across two interfaces and reuses the already composed BaseConfig which includes ClusterProvider and ExtendedConfigProvider. Reverts changes to pkg/api/config.go and pkg/kiali/kiali.go since no new interface is needed. Refs containers#836 Signed-off-by: Marc Nuri <marc@marcnuri.com> --------- Signed-off-by: Marc Nuri <marc@marcnuri.com>
Member
|
I believe this was superseded by #916. Should we close it? |
Member
|
Closing as I think this one is no longer necessary #916 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we initially made the cluster provider strategy, the thinking was that everything could be handled transparently from the toolsets. While this has been true for the most part, as some toolsets are now adding functionality that calls to non kube API server APIs (e.g. a prometheus instance in the cluster), this somewhat breaks down.
In these scenarios, there is sometimes a need for the toolset to know what the strategy was so that it can determine if it needs/should use extra config (e.g. TLS config if not in the cluster).
This attempts to expose that config to toolsets where they can optionally consume it as needed