Closed ijc closed 7 years ago
Yeah, I remember thinking about this when I did it and wasn't sure how it should be done. I think you are right and it makes sense for the next level of runtime
to be treated individually not as a whole.
I don't know if it is worth trying to rewrite as a generic thing with reflection. It is only a few keys so fixing it up should be relatively easy as a first fix. But the code is a bit messy now.
I'll knock something up based on the existing pattern.
My main reason for thinking about reflection was so as to not have to add code to two places (struct and the assign func) when adding a field, also it could potentially make deeper nesting possible.
this was resolved in #153
If I specify a
Runtime
section in my yml then it overrides the entireruntime
provided by the pkg in theorg.mobyproject.config
label on the image, even though the image defines onlyruntime.mkdir
and the yml only overridesruntime.bindns
.Looking at the code in
config.go
it looks likeoci.Linux
is handled properly by unpacking one level. Shouldruntime
do the same? It looks likeResources
might be in a similar situation too.I wonder if it would be possible to write a generic struct merger using reflection or if such a thing already exists.