Skip to content

Better automatically generated controller names? #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
metacosm opened this issue Jan 14, 2021 · 6 comments
Closed

Better automatically generated controller names? #301

metacosm opened this issue Jan 14, 2021 · 6 comments
Assignees

Comments

@metacosm
Copy link
Collaborator

metacosm commented Jan 14, 2021

Very often a controller class will be named SomethingController or SomethingResourceController. We could trim these names to remove the redundant Controller or ResourceController part so that they feel more natural when referring to the controller in configuration files. Another option would be to use the associated Custom Resource name / kind as the default name for the controller. /cc @adam-sandor @psycho-ir

@adam-sandor
Copy link
Collaborator

Hmm.. I don't know. The class itself would look weird without the suffix. And it may cause problems with naming the CR. For example I have a class Tomcat for the CR and related TomcatController.

@metacosm
Copy link
Collaborator Author

Hmm.. I don't know. The class itself would look weird without the suffix. And it may cause problems with naming the CR. For example I have a class Tomcat for the CR and related TomcatController.

The name of the class wouldn't change, just the name that is used to refer to the controller in the configuration. In the above example, your CR would still be Tomcat, your controller class would still be called TomcatController, however the default controller name would become tomcat instead of tomcatcontroller as it is now.

@metacosm metacosm self-assigned this Jan 14, 2021
@adam-sandor
Copy link
Collaborator

Ah ok.. that's fine. Tbh I don't even know where we use controller names in configuration

@metacosm
Copy link
Collaborator Author

metacosm commented Jan 14, 2021

Ah ok.. that's fine. Tbh I don't even know where we use controller names in configuration

We don't really at the moment… 😄 but we should with #237. Note that most of the code is in place for this to work but it needs to be completed.

@s-soroosh
Copy link
Contributor

s-soroosh commented Jan 14, 2021

To me, the controller name itself is more natural than doing any change by convention,
I don't like to think about removing the controller suffix if it's there but just using the class name itself if I decided to user another suffix like Manager or anything similar to that.
and given that a custom resource can have more than a controller I don't think it can be replaced by the resource name.

@metacosm
Copy link
Collaborator Author

and given that a custom resource can have more than a controller I don't think it can be replaced by the resource name.

More complex use cases might indeed run into that issue. Closing this then. Thanks for the input!

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

No branches or pull requests

3 participants