Manifest schema now validates partition definition

S3 partitioning is disallowed for now
This commit is contained in:
Anders Ingemann 2013-10-29 22:41:29 +01:00
parent cf3c861a27
commit 71adb3d04e
4 changed files with 85 additions and 33 deletions

View file

@ -9,37 +9,36 @@
"bootstrapper": { "bootstrapper": {
"type": "object", "type": "object",
"properties": { "properties": {
"workspace": { "type": "string" }, "workspace": { "$ref": "#/definitions/path" },
"mirror": { "type": "string" }, "mirror": { "type": "string", "format": "uri" },
"tarball": { "type": "boolean" } "tarball": { "type": "boolean" }
}, },
"required": ["workspace"] "required": ["workspace"]
}, },
"system": { "system": {
"type": "object", "type": "object",
"properties": { "properties": {
"release": { "release": { "enum": ["wheezy"] },
"type": "string", "architecture": { "enum": ["i386", "amd64"] },
"enum": ["wheezy"] "timezone": { "type": "string" },
}, "locale": { "type": "string" },
"architecture": { "charmap": { "type": "string" }
"type": "string",
"enum": ["i386", "amd64"]
},
"timezone": { "type": "string" },
"locale": { "type": "string" },
"charmap": { "type": "string" }
}, },
"required": ["release", "architecture", "timezone", "locale", "charmap"] "required": ["release", "architecture", "timezone", "locale", "charmap"]
}, },
"volume": { "volume": {
"type": "object" "type": "object",
// "properties": { "properties": {
// "backing": { "backing": { "type": "string" },
// "type": "string" "partitions": {
// } "type": "object",
// }, "oneOf": [
// "required": ["backing"] { "$ref": "#/definitions/no_partitions" },
{ "$ref": "#/definitions/partition_table" }
]
}
},
"required": ["partitions"]
}, },
"plugins": { "plugins": {
"type": "object", "type": "object",
@ -57,5 +56,44 @@
"additionalProperties": false "additionalProperties": false
} }
}, },
"required": ["provider", "bootstrapper", "volume", "system"] "required": ["provider", "bootstrapper", "volume", "system"],
"definitions": {
"path": {
"type": "string",
"pattern": "^[^\\0]+$"
},
"no_partitions": {
"type": "object",
"properties": {
"type": { "enum": ["none"] },
"root": { "$ref": "#/definitions/partition" }
},
"required": ["root"],
"additionalProperties": false
},
"partition_table": {
"type": "object",
"properties": {
"type": { "enum": ["mbr", "gpt"] },
"boot": { "$ref": "#/definitions/partition" },
"root": { "$ref": "#/definitions/partition" },
"swap": {
"type": "object",
"properties": { "size": { "type": "integer", "minimum": 1 } },
"required": ["size"]
}
},
"required": ["root"],
"additionalProperties": false
},
"partition": {
"type": "object",
"properties": {
"size": { "type": "integer", "minimum": 1 },
"filesystem": { "enum": ["ext2", "ext3", "ext4", "xfs"] }
},
"required": ["size", "filesystem"]
}
},
"required": ["provider", "bootstrapper", "system", "volume"]
} }

View file

@ -25,6 +25,17 @@
} }
}, },
"required": ["bucket"] "required": ["bucket"]
},
"volume": {
"type": "object",
"properties": {
"partitions": {
"type": "object",
"properties": {
"type": { "enum": ["none"] }
}
}
}
} }
}, },
"required": ["image"] "required": ["image"]

View file

@ -3,6 +3,17 @@
"title": "EC2 manifest", "title": "EC2 manifest",
"type": "object", "type": "object",
"properties": { "properties": {
"image": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
},
"credentials": { "credentials": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -17,13 +28,10 @@
"volume": { "volume": {
"type": "object", "type": "object",
"properties": { "properties": {
"backing": { "backing": { "enum": ["ebs", "s3"] }
"type": "string",
"enum": ["ebs", "s3"]
}
}, },
"required": ["backing"] "required": ["backing"]
} }
}, },
"required": ["volume"] "required": ["image"]
} }

View file

@ -10,13 +10,8 @@
"type": "string", "type": "string",
"enum": ["raw", "vdi", "qcow2"] "enum": ["raw", "vdi", "qcow2"]
} }
// "filesystem": {
// "type": "string",
// "enum": ["ext2", "ext3", "ext4", "xfs"]
// }
}, },
"required": ["backing"] "required": ["backing"]
} }
}, }
"required": ["volume"]
} }