Hi Dan,
To supplement Varsha's answer.
What PROJECT file stores?
The PROJECT file was introduced since Kubebuilder release 3.0.0, where the Plugins design was introduced. Its purpose is mainly to track all data used to do the scaffolds. It stores more information about what resources and plugins are in use, to better enable plugins to make useful decisions when scaffolding
. ( see an example[1] ).
Why do we need to store the plugins used?
Kubebuilder allows and provides you opt-in to use plugins, indeed optional ones. Track the information required, for example:
- we can check if one plugin can or not be used/supported in the scaffold done
- what operations can or not be done
- what data can or not be used in the CLI operations
Note that Kubebuilder is no longer only a CLI tool but can also be used as a lib to allow others to create their plugins/tools and provide helpers and customizations on top of what is done for it, such as it is done by
Operator-SDK[2]. SDK leverages Kubebuilder to create plugins to allow users to work with other languages and provide helpers for their users to integrate their projects with the
Operator Framework solutions/OLM[3]. Check
here[4] to know more about the plugin's vision.
Additionally motivations
On top of that, another motivation for the PROJECT file would help us to create a feature to allow users easier upgrade their projects by providing allowing to automatically re-scaffold the project: Since we scaffold all data used to do the scaffold, we could automate the steps and have a command that would re-create the project in the latest version by re-doing all commands. More info:
https://github.com/kubernetes-sigs/kubebuilder/pull/2895