kubebuilder
kubebuilder copied to clipboard
Scaffold a comment in the PROJECT file to let users know that they should not update it
What do you want to happen?
I'd like to see in the PROJECT file something like:
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
So that, we could make clear that users should not change it. Motivation: https://github.com/kubernetes-sigs/kubebuilder/issues/2634
PS.: Note that if we go into the store.go and try to add the comment when the file is created the following error will be faced when we try to parse / unmarshal it:
Error: unable to load the configuration: unable to determine config version: error converting YAML to JSON: yaml: line 18: mapping values are not allowed in this context
In this way, we need to see if new versions of the libs to work with YAML used can deal with comments or check if we can provide an alternative solution.
Extra Labels
No response
/assign
From the KB meeting: Maybe would be better something like "# Code generated by tool. DO NOT EDIT IF YOU DO NOT KNOW WHAT YOU ARE DOING" OR AT YOUR RISK.
Hi, @camilamacedo86 and @laxmikantbpandhare.
I've tried adding simple prepend on yaml pkg's Save()
function for this.
But I can't seem to observe the same unable to load the configuration
error(unit tests+manual 'init,' 'create api' calls), so I've made a pr(#3137) for now.
Let me know if you've planned a different approach, or I've missed something.
Hi @jason1028kr,
We can close this one as done. Thank you for your contribution !!!