Skip to content

Allow every command to overwrite project-configured plugins #1941

Closed
@Adirio

Description

@Adirio

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions