Skip to content

Conversation

@manusa
Copy link
Member

@manusa manusa commented Oct 17, 2025

Removed *Manager parameter from ProviderFactory.

Provider implementations should deal with the appropriate (base) Manager instantiation if needed at all.

Manager creation function divided into two explicit functions:

  • NewKubeconfigManager: to be used when using KubeConfig files
  • NewInClusterManager: to be used inside a cluster

New functions contain validations to ensure they are used in the expected places. This ensures that the right manager is used by the provider implementation.

Fake kubeconfig for in-cluster Manager is now generated when the Manager is created. This kubeconfig has the "magic" strings (inClusterKubeConfigDefaultContext) that are used by the MCP server and tool mutators.

…antiations

Removed `*Manager` parameter from `ProviderFactory`.

Provider implementations should deal with the appropriate (base) Manager instantiation
if needed at all.

Manager creation function divided into two explicit functions:
- NewKubeconfigManager: to be used when using KubeConfig files
- NewInClusterManager: to be used inside a cluster

New functions contain validations to ensure they are used in the expected places.
This ensures that the right manager is used by the provider implementation.

Fake kubeconfig for in-cluster Manager is now generated when the Manager is created.
This kubeconfig has the "magic" strings (inClusterKubeConfigDefaultContext) that are
used by the MCP server and tool mutators.

Signed-off-by: Marc Nuri <[email protected]>
@manusa
Copy link
Member Author

manusa commented Oct 17, 2025

This should be the last of the changes I had in mind for the Povider-Manager problem 😅

It breaks openshift#58 a little, but I think that it simplifies its ProviderFactory implementations since many of the checks won't be necessary :)

@manusa manusa requested a review from Cali0707 October 17, 2025 17:13
@matzew
Copy link
Collaborator

matzew commented Oct 20, 2025

LGTM me, overall

I like the cleaner approach of this

@manusa manusa added this to the 0.1.0 milestone Oct 20, 2025
@matzew matzew merged commit 7f4edfd into containers:main Oct 20, 2025
6 checks passed
@manusa manusa deleted the refactor/provider branch October 20, 2025 14:59
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