Description
When resolivng which plugins will handle each command, we currently have 3 sources for the project version and plugin keys: project configuration file, flags or default values.
Init commands will not have a project configuration file, so the precedence is clear, flags override default values. However, the rest of the commands require a project configuration so they have 2 sources that are at the same level, flags and project configuration, both overriding the default values. If both flags and project configuration are present, the current approach is to fail in case they are different. This makes total sense for the project version, as you can't run a create command for project version 3 on a project version , obviously. But in the case of plugins, we may want to allow them to be different.
Let's say that we create a plugin that modifies the controller.go
file to insert inside the reconcile function some scaffold code and/or that creates a controller_test.go
scaffold. We may want to use this plugin for some of the controllers generated in this project but not for all of them.
I would allow command calls' --plugin
flag to temporaly override the layout
field set in the project configuration file. And by temporaly override I mean that this command call will be called with the values of the flag but the project configuration layout
field will not be modified, and therefore, succesive command calls will still use the plugins configured during project initialization.