This repository has been archived by the owner on Oct 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Allow extending the schema #209
Comments
We originally added validation as ignoring typo fields is annoying and hard
to debug. I think this still maybe an issue but we could add some options
eg --allow-extra or ignore fields that match a pattern like x-* headers.
…On Sat, 24 Mar 2018, 06:00 Erno Aapa, ***@***.***> wrote:
Hi,
I'm building RaspberryPI3 images with linuxkit
<https://github.com/linuxkit/linuxkit> through linuxkit-server
<https://github.com/ernoaapa/linuxkit-server>.
To make building the sdcard as easy as possible, I added to
linuxkit-server capability to request the output in img-file what users can
easily flash to sd-card for example with dd.
I would like to build support for defining disk partitions in the linuxkit
yaml-file, but cannot because linuxkit build fails because it doesn't allow
any extra fields to exist in the yaml-file.
My options are:
1. Change moby/tool schema to allow extra fields (change here
<https://github.com/moby/tool/blob/master/src/moby/schema.go#L7>
additionalProperties=true)
2. unmarshal yaml, drop extra fields, marshal back to []byte and call
Moby
3. Something else?
It's quite common for example in JSON APIs to ignore extra fields, so
maybe also, in this case, it make sense. What do you think? It would allow
the community to build extra features on top of Moby/Linuxkit what is not
suitable to be merged into the core.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#209>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAdcPD158AierMXozw1PkBmxNsMq8NKCks5thm2agaJpZM4S5ydf>
.
|
Validation sounds like a good reason and because of that, made me think that maybe it's good to keep it as it is. I just need to find a way, how can I drop the extra property before I pass the yaml bytes to the moby.Build. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I'm building RaspberryPI3 images with linuxkit through linuxkit-server.
To make building the sdcard as easy as possible, I added to linuxkit-server capability to request the output in img-file what users can easily flash to sd-card for example with
dd
.I would like to build support for defining disk partitions in the linuxkit yaml-file, but cannot because linuxkit build fails because it doesn't allow any extra fields to exist in the yaml-file.
My options are:
moby/tool
schema to allow extra fields (change hereadditionalProperties=true
)[]byte
and call MobyIt's quite common for example in JSON APIs to ignore extra fields, so maybe also, in this case, it make sense. What do you think? It would allow the community to build extra features on top of Moby/Linuxkit what is not suitable to be merged into the core.
The text was updated successfully, but these errors were encountered: