formats/v2: mounts are arrays

The order of entries in a dictionary is not specified by the JSON
standard and hard to control when marshalling dictionaries in Go.
Since the order of mounts is important and the wrong order leads
to wrong mount trees change the `mounts` field to an array. This
breaks existing manifests but after careful deliberation it was
concluded that the original schema with mounts as dictionaries
is not something we want to support. Apologies to everyone.

Adjust the schema of the copy and zipl stage accordingly.
This commit is contained in:
Christian Kellner 2021-07-20 17:34:04 +00:00
parent 50627b713c
commit ae1296e33a
8 changed files with 57 additions and 45 deletions

View file

@ -1763,13 +1763,14 @@
}
}
},
"mounts": {
"root": {
"mounts": [
{
"name": "root",
"type": "org.osbuild.ext4",
"source": "root",
"target": "/"
}
}
]
}
]
},
@ -1935,13 +1936,14 @@
}
}
},
"mounts": {
"efi": {
"mounts": [
{
"name": "efi",
"type": "org.osbuild.fat",
"source": "efi",
"target": "/"
}
}
]
},
{
"type": "org.osbuild.copy",

View file

@ -534,13 +534,14 @@
}
}
},
"mounts": {
"root": {
"mounts": [
{
"name": "root",
"type": "org.osbuild.ext4",
"source": "root",
"target": "/"
}
}
]
}
]
},
@ -720,13 +721,14 @@
}
}
},
"mounts": {
"efi": {
"mounts": [
{
"name": "efi",
"type": "org.osbuild.fat",
"source": "efi",
"target": "/"
}
}
]
},
{
"type": "org.osbuild.copy",

View file

@ -1080,23 +1080,26 @@
}
}
},
"mounts": {
"root": {
"mounts": [
{
"name": "root",
"type": "org.osbuild.xfs",
"source": "root",
"target": "/"
},
"boot": {
{
"name": "boot",
"type": "org.osbuild.ext4",
"source": "boot",
"target": "/boot"
},
"efi": {
{
"name": "efi",
"type": "org.osbuild.fat",
"source": "efi",
"target": "/boot/efi"
}
}
]
},
{
"type": "org.osbuild.grub2.inst",

View file

@ -534,23 +534,26 @@
}
}
},
"mounts": {
"root": {
"mounts": [
{
"name": "root",
"type": "org.osbuild.xfs",
"source": "root",
"target": "/"
},
"boot": {
{
"name": "boot",
"type": "org.osbuild.ext4",
"source": "boot",
"target": "/boot"
},
"efi": {
{
"name": "efi",
"type": "org.osbuild.fat",
"source": "efi",
"target": "/boot/efi"
}
}
]
},
{
"type": "org.osbuild.grub2.inst",