Skip to content

Improve handling of Custom Resource Client #199

Closed
@adam-sandor

Description

@adam-sandor

There are two problems with controller that want to modify their custom resource objects using the special client Fabric8 provides for these operations (MixedOperation interface).

  1. The client gets created in the Operator using a somewhat complicated mechanism, and there is no good way to get hold of the client object in the controller.

  2. The type of the client is horrific abomination of generics, so if I do manage to get it into the controller it looks like this: private MixedOperation<Tomcat, CustomResourceList<Tomcat>, CustomResourceDoneable<Tomcat>, Resource<Tomcat, CustomResourceDoneable<Tomcat>>> tomcatOperations;

One possible solution is to pass the client to the controller in the context object, which solves both problems. The downside is that controllers get the KubernetesClient passed in their constructor so it looks a bit weird to pass the custom resource client in the context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions