opencompose
opencompose copied to clipboard
Passing in multiple files does not work
OpenCompose CLI barfs when multiple files are provided.
$ opencompose convert -f examples/hello-nginx-external.yaml -f examples/hello-nginx.yaml
ERROR: unable to read file 'examples/hello-nginx-external.yaml,examples/hello-nginx.yaml': open examples/hello-nginx-external.yaml,examples/hello-nginx.yaml: no such file or directory
$ opencompose convert -f examples/hello-nginx-external.yaml,examples/hello-nginx.yaml
ERROR: unable to read file 'examples/hello-nginx-external.yaml,examples/hello-nginx.yaml': open examples/hello-nginx-external.yaml,examples/hello-nginx.yaml: no such file or directory
Neither of the above cases work.
Update:
- [ ] The first problem is that our vendored viper is pretty old, and hence multiple files are not even getting parsed. This is being fixed by updated the vendor directory.
But there is more to this problem, merging different object.OpenCompose structs has not been implemented yet https://github.com/redhat-developer/opencompose/blob/master/pkg/cmd/convert.go#L106, and currently, only the input from the first file passed is taken into account.
- [ ] Now, we need to implement merging of different
object.OpenComposeobjects, which means implementing the immutable keys table from https://github.com/redhat-developer/opencompose/pull/149#issuecomment-305265754 and implement merging of objects based on this table.
We are assuming that all the files being passed are a part of one application written in OpenCompose and we will be merging them.
- [ ] We should log each time an override is done
- [ ] We should document this behavior, since this includes overriding fields and hence loss of some information
CC: @kadel