Skip to content

Conversation

manusa
Copy link
Member

@manusa manusa commented Oct 10, 2025

Initial phase to unify-merge the Provider interface with the Manager struct.

  • Renamed ManagerProvider to Provider (i.e. kubernets.Provider)
  • Moved Manager related logic to specific files
  • Exposed relevant method through Provider interface (GetDerivedKubernetes, IsOpenShift, VerifyToken)

/cc @Cali0707

@manusa manusa force-pushed the fix/kubernetes-provider branch 2 times, most recently from 51a65fe to e355e10 Compare October 10, 2025 13:23
Comment on lines +83 to +85
func (p *kubeConfigClusterProvider) IsOpenShift(ctx context.Context) bool {
return p.managers[p.defaultContext].IsOpenShift(ctx)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced is the IsOpenShift method makes sense here - what if there are a mix of openshift and non openshift clusters in the kubeconfig?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can either:

  1. check if any of the clusters are openshift
  2. figure out a way to set the "contexts" parameter for the openshift specific tools to only include the contexts which are openshift

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of the legacy behavior where the Kubernetes MCP server is supposed to adapt to the underlying Kubernetes clusters and provide flavor-specific tools.

In the current state, the toolsets GetTools method receive this interface and can perform some logic to register tools based on the provided information.

With the Multi-Cluster approach and the segregation of toolsets, this might not be applicable any more.

I was going to add a TODO comment in the Provider interface definition beside the OpenShift reference indicating that this was going to be removed.
But since I'm not sure of how we want to move forward, I didn't.

Maybe we can either:

  1. check if any of the clusters are openshift
  2. figure out a way to set the "contexts" parameter for the openshift specific tools to only include the contexts which are openshift

These are valid options, the other alternative is to just remove the interface and provide a base openshift toolset.

Since it's unclear, and there are a few more refactors pending from my side, I think that the // TODO comment would be enough for now.

Thoughts?


// derive the manager based on auth on top of the settings for the cluster
k, err := m.Derived(ctx)
k, err := s.p.GetDerivedKubernetes(ctx, cluster)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is great

@manusa manusa force-pushed the fix/kubernetes-provider branch from a7dc685 to 68a2d71 Compare October 13, 2025 10:31
@manusa manusa added this to the 0.1.0 milestone Oct 13, 2025
manusa and others added 2 commits October 13, 2025 13:12
…face

Initial phase to unify-merge the Provider interface with the Manager struct.

- Renamed ManagerProvider to Provider (i.e. kubernets.Provider)
- Moved Manager related logic to specific files
- Exposed relevant method through Provider interface (GetDerivedKubernetes, IsOpenShift, VerifyToken)

Signed-off-by: Marc Nuri <[email protected]>
Co-authored-by: Calum Murray <[email protected]>
Signed-off-by: Marc Nuri <[email protected]>
@manusa manusa force-pushed the fix/kubernetes-provider branch from 68a2d71 to 6a58d29 Compare October 13, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants