Skip to content

Remove customResourceClass from @Controller #224

Closed
@s-soroosh

Description

@s-soroosh

Given that the ResourceController must implement io.javaoperatorsdk.operator.api.ResourceController<R extends CustomResource>, IMO getting the customResourceClass in io.javaoperatorsdk.operator.api.Controller is unnecessary and may cause inconsistencies, e.g. developer set a different class in annotation comparing with the one defined in Controller class definition.

I would suggest to remove the mentioned attribute from annotation and take the class type from the actual controller object.
e.g.

@Controller(
        generationAwareEventProcessing = false,
        crdName = TestCustomResourceController.CRD_NAME,
        **customResourceClass = TestCustomResource.class**)
public class TestCustomResourceController implements ResourceController<TestCustomResource>, TestExecutionInfoProvider {

will be come

@Controller(
        generationAwareEventProcessing = false,
        crdName = TestCustomResourceController.CRD_NAME)
public class TestCustomResourceController implements ResourceController<TestCustomResource>, TestExecutionInfoProvider {

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