Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

kedge init generates invalid kedge file #396

Closed
kadel opened this issue Oct 30, 2017 · 1 comment · Fixed by #399
Closed

kedge init generates invalid kedge file #396

kadel opened this issue Oct 30, 2017 · 1 comment · Fixed by #399

Comments

@kadel
Copy link
Member

kadel commented Oct 30, 2017

▶ ./kedge init -c DeploymentConfig -i tomaskral/nonroot-nginx -p 8080 --name demo
file kedge.yml created

▶ ./kedge generate -f kedge.yml
unable to perform controller operations: unable to unmarshal data: could not unmarshal into internal struct: error unmarshaling JSON: json: cannot unmarshal number into Go struct field ServiceSpecMod.portMappings of type string

I believe this is one of the side effects of using structs to create kedge file :-(
#353

ping @surajssd

@kadel kadel added this to the 0.5.0 milestone Oct 30, 2017
@kadel
Copy link
Member Author

kadel commented Oct 31, 2017

Why there are the same types defined again in init.go https://github.com/kedgeproject/kedge/blob/d6c365baeed607fb0767b4890b38fdde1304d90e/cmd/init.go#L38d/init.go#L41 ?

It should reuse types from types.go. Otherwise, what is the point of using structs?

The current approach duplication and it is error-prone. This bug is a great example of errors this can lead to.

kadel added a commit to kadel/kedge that referenced this issue Oct 31, 2017
portMappings should be []string not []int
fixes kedgeproject#396
cdrage pushed a commit that referenced this issue Oct 31, 2017
portMappings should be []string not []int
fixes #396
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant