Skip to content

Conversation

@manusa
Copy link
Member

@manusa manusa commented Nov 25, 2025

Simplifies the relationship between the Manager, Kubernetes, and AccessControlClientset types.
The changes reduce indirection and move functionality to more appropriate locations.

Kubernetes no longer wraps a Manager which could be confusing especially for the derived scenarios.

Manger should only concern with the lifecycle management and the derived instance creation (wip).
All access to the cluster should be done from a derived Kubernetes instance (wip).

@manusa manusa added this to the 0.1.0 milestone Nov 25, 2025
@manusa manusa requested a review from Cali0707 November 25, 2025 14:10
…anager and Kubernetes structs

Signed-off-by: Marc Nuri <marc@marcnuri.com>
@manusa manusa force-pushed the refactor/kubernetes-manager branch from b1e7b0b to 6148224 Compare November 25, 2025 15:18
Comment on lines +60 to +71
func (k *Kubernetes) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error) {
return k.AccessControlClientset().DiscoveryClient(), nil
}

func (k *Kubernetes) ToRESTMapper() (meta.RESTMapper, error) {
return k.AccessControlClientset().RESTMapper(), nil
}

// ToRESTConfig returns the rest.Config object (genericclioptions.RESTClientGetter)
func (k *Kubernetes) ToRESTConfig() (*rest.Config, error) {
return k.AccessControlClientset().cfg, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@manusa do we want to keep the error in the return types here? I understand changing that would be a breaking change downstream, but I think long term it could simplify our code somewhat if we don't anticipate changes re-introducing the error value here

Copy link
Member Author

Choose a reason for hiding this comment

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

These methods are the implementation of the genericclioptions.RESTClientGetter (note they basically duplicate the ones already available through the AccessControlClientset).

These were before at the Manager level (here I'm trying to trim off any access to Kubernetes)

It's my understanding that other clients, besides helm, might end up using this interface. That's the main reasoning to having them here.

…anager and Kubernetes structs (review)

Signed-off-by: Marc Nuri <marc@marcnuri.com>
@manusa manusa requested a review from Cali0707 November 26, 2025 08:30
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