func: `func` does not retain user comments on `func.yaml`

Comments added on func.yaml by developers are lost every time a func command that writes to this file is executed.

As an example, I added a label (or env var), then I manually changed the func.yaml with a comment to describe that label (or env).

labels:
# My label
- key: mylabel
  value: myvalue

After adding another label thru func config, or after running a func build my comment get removed from the yaml file.

labels:
- key: mylabel
  value: myvalue

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

It seems that yaml is the wrong format

💯

@lance perhaps we should close this issue? We’ll of course need a constant campaign of directing users to the func cli for imperative mutations of their Function’s metadata, and to their source code itself for declarative. In addition, maybe now is the time to re-start the conversation about the in-function-instance API for accomplishing many of the tasks people who are familiar with kubectl or kn may first think to look in a .yaml for out of habit; and start gently moving towards source code declarations