cli icon indicating copy to clipboard operation
cli copied to clipboard

"fn deploy" deletes comments from the func file

Open denismakogon opened this issue 6 years ago • 4 comments

Problem

fn deploy deletes comments from the func file.

Steps to reproduce

Assume that you have comments in func file:

name: func
version: 0.0.1
runtime: go
type: async
memory: 64
format: json
timeout: 10
path: /submit
config:
## this is A
  A: "A"
## this is B
  B: "B"

then call the deploy:

$ fn -v deploy --registry `whoami`

Problem area

Comments will go away. This happens because CLI basically rewrites the func file.

Use cases

There are few valid use cases that i can foresee like:

  • "comment temporarily the config var, call the deploy"
  • "in comments i want to put the env vars description"

maybe something else there?

denismakogon avatar Apr 22 '18 10:04 denismakogon

+1 . i think we should honor comments.

carimura avatar Apr 22 '18 15:04 carimura

Would probably need to put version somewhere else.

treeder avatar Apr 22 '18 16:04 treeder

@treeder maybe, the only thing we need to change is the version, however, removed comments appeared to be a known issue: https://github.com/go-yaml/yaml/pull/219 and it's not going to be resolved soon =/

denismakogon avatar Apr 22 '18 18:04 denismakogon

I mean that we wouldn't touch the func.yaml file so the comments would stay where they are.

treeder avatar Apr 23 '18 17:04 treeder