Merge pull request #662 from wking/json-schema-no-pointer

schema: Drop pointers and nulls
This commit is contained in:
Qiang Huang 2017-02-06 10:41:35 +08:00 committed by GitHub
commit ce0783aa1c
5 changed files with 36 additions and 144 deletions

View File

@ -72,11 +72,11 @@
"properties": { "properties": {
"blkioWeight": { "blkioWeight": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioWeight", "id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioWeight",
"$ref": "defs-linux.json#/definitions/blkioWeightPointer" "$ref": "defs-linux.json#/definitions/blkioWeight"
}, },
"blkioLeafWeight": { "blkioLeafWeight": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioLeafWeight", "id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioLeafWeight",
"$ref": "defs-linux.json#/definitions/blkioWeightPointer" "$ref": "defs-linux.json#/definitions/blkioWeight"
}, },
"blkioThrottleReadBpsDevice": { "blkioThrottleReadBpsDevice": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioThrottleReadBpsDevice", "id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioThrottleReadBpsDevice",
@ -129,23 +129,23 @@
}, },
"period": { "period": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/period", "id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/period",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
}, },
"quota": { "quota": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/quota", "id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/quota",
"$ref": "defs.json#/definitions/int64Pointer" "$ref": "defs.json#/definitions/int64"
}, },
"realtimePeriod": { "realtimePeriod": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/realtimePeriod", "id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/realtimePeriod",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
}, },
"realtimeRuntime": { "realtimeRuntime": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/realtimeRuntime", "id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/realtimeRuntime",
"$ref": "defs.json#/definitions/int64Pointer" "$ref": "defs.json#/definitions/int64"
}, },
"shares": { "shares": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/shares", "id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/shares",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
} }
} }
}, },
@ -178,27 +178,27 @@
"properties": { "properties": {
"kernel": { "kernel": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernel", "id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernel",
"$ref": "defs.json#/definitions/int64Pointer" "$ref": "defs.json#/definitions/int64"
}, },
"kernelTCP": { "kernelTCP": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernelTCP", "id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernelTCP",
"$ref": "defs.json#/definitions/int64Pointer" "$ref": "defs.json#/definitions/int64"
}, },
"limit": { "limit": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/limit", "id": "https://opencontainers.org/schema/bundle/linux/resources/memory/limit",
"$ref": "defs.json#/definitions/int64Pointer" "$ref": "defs.json#/definitions/int64"
}, },
"reservation": { "reservation": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/reservation", "id": "https://opencontainers.org/schema/bundle/linux/resources/memory/reservation",
"$ref": "defs.json#/definitions/int64Pointer" "$ref": "defs.json#/definitions/int64"
}, },
"swap": { "swap": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swap", "id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swap",
"$ref": "defs.json#/definitions/int64Pointer" "$ref": "defs.json#/definitions/int64"
}, },
"swappiness": { "swappiness": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swappiness", "id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swappiness",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
} }
} }
}, },
@ -255,14 +255,7 @@
}, },
"sysctl": { "sysctl": {
"id": "https://opencontainers.org/schema/bundle/linux/sysctl", "id": "https://opencontainers.org/schema/bundle/linux/sysctl",
"oneOf": [ "$ref": "defs.json#/definitions/mapStringString"
{
"$ref": "defs.json#/definitions/mapStringString"
},
{
"type": "null"
}
]
}, },
"maskedPaths": { "maskedPaths": {
"id": "https://opencontainers.org/schema/bundle/linux/maskedPaths", "id": "https://opencontainers.org/schema/bundle/linux/maskedPaths",

View File

@ -14,11 +14,11 @@
"properties": { "properties": {
"limit": { "limit": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/memory/limit", "id": "https://opencontainers.org/schema/bundle/windows/resources/memory/limit",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
}, },
"reservation": { "reservation": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/memory/reservation", "id": "https://opencontainers.org/schema/bundle/windows/resources/memory/reservation",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
} }
} }
}, },
@ -28,15 +28,15 @@
"properties": { "properties": {
"count": { "count": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/count", "id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/count",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
}, },
"shares": { "shares": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/shares", "id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/shares",
"$ref": "defs-windows.json#/definitions/cpuSharesPointer" "$ref": "defs-windows.json#/definitions/cpuShares"
}, },
"percent": { "percent": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/percent", "id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/percent",
"$ref": "defs.json#/definitions/percentPointer" "$ref": "defs.json#/definitions/percent"
} }
} }
}, },
@ -46,15 +46,15 @@
"properties": { "properties": {
"iops": { "iops": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/storage/iops", "id": "https://opencontainers.org/schema/bundle/windows/resources/storage/iops",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
}, },
"bps": { "bps": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/storage/bps", "id": "https://opencontainers.org/schema/bundle/windows/resources/storage/bps",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
}, },
"sandboxSize": { "sandboxSize": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/storage/sandboxSize", "id": "https://opencontainers.org/schema/bundle/windows/resources/storage/sandboxSize",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
} }
} }
}, },
@ -64,7 +64,7 @@
"properties": { "properties": {
"egressBandwidth": { "egressBandwidth": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/network/egressBandwidth", "id": "https://opencontainers.org/schema/bundle/windows/resources/network/egressBandwidth",
"$ref": "defs.json#/definitions/uint64Pointer" "$ref": "defs.json#/definitions/uint64"
} }
} }
} }

View File

@ -126,24 +126,10 @@
"$ref": "#/definitions/Minor" "$ref": "#/definitions/Minor"
}, },
"uid": { "uid": {
"oneOf": [ "$ref": "defs.json#/definitions/UID"
{
"$ref": "defs.json#/definitions/UID"
},
{
"type": "null"
}
]
}, },
"gid": { "gid": {
"oneOf": [ "$ref": "defs.json#/definitions/GID"
{
"$ref": "defs.json#/definitions/GID"
},
{
"type": "null"
}
]
} }
} }
}, },
@ -152,16 +138,6 @@
"minimum": 10, "minimum": 10,
"maximum": 1000 "maximum": 1000
}, },
"blkioWeightPointer": {
"oneOf": [
{
"$ref": "#/definitions/blkioWeight"
},
{
"type": "null"
}
]
},
"blockIODevice": { "blockIODevice": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -187,10 +163,10 @@
"type": "object", "type": "object",
"properties": { "properties": {
"weight": { "weight": {
"$ref": "#/definitions/blkioWeightPointer" "$ref": "#/definitions/blkioWeight"
}, },
"leafWeight": { "leafWeight": {
"$ref": "#/definitions/blkioWeightPointer" "$ref": "#/definitions/blkioWeight"
} }
} }
} }
@ -221,24 +197,10 @@
"$ref": "string" "$ref": "string"
}, },
"major": { "major": {
"oneOf": [ "$ref": "#/definitions/Major"
{
"$ref": "#/definitions/Major"
},
{
"type": "null"
}
]
}, },
"minor": { "minor": {
"oneOf": [ "$ref": "#/definitions/Minor"
{
"$ref": "#/definitions/Minor"
},
{
"type": "null"
}
]
}, },
"access": { "access": {
"$ref": "string" "$ref": "string"

View File

@ -5,16 +5,6 @@
"type": "integer", "type": "integer",
"minimum": 1, "minimum": 1,
"maximum": 10000 "maximum": 10000
},
"cpuSharesPointer": {
"oneOf": [
{
"$ref": "#/definitions/cpuShares"
},
{
"type": "null"
}
]
} }
} }
} }

View File

@ -46,56 +46,6 @@
"minimum": 0, "minimum": 0,
"maximum": 100 "maximum": 100
}, },
"intPointer": {
"oneOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"int64Pointer": {
"oneOf": [
{
"$ref": "#/definitions/int64"
},
{
"type": "null"
}
]
},
"uint16Pointer": {
"oneOf": [
{
"$ref": "#/definitions/uint16"
},
{
"type": "null"
}
]
},
"uint64Pointer": {
"oneOf": [
{
"$ref": "#/definitions/uint64"
},
{
"type": "null"
}
]
},
"percentPointer": {
"oneOf": [
{
"$ref": "#/definitions/percent"
},
{
"type": "null"
}
]
},
"mapStringString": { "mapStringString": {
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
@ -141,9 +91,13 @@
"$ref": "#/definitions/Env" "$ref": "#/definitions/Env"
}, },
"timeout": { "timeout": {
"$ref": "#/definitions/intPointer" "$ref": "#/definitions/int"
} }
} },
"required": [
"args",
"path"
]
}, },
"ArrayOfHooks": { "ArrayOfHooks": {
"type": "array", "type": "array",
@ -197,14 +151,7 @@
"type": "string" "type": "string"
}, },
"annotations": { "annotations": {
"oneOf": [ "$ref": "#/definitions/mapStringString"
{
"$ref": "#/definitions/mapStringString"
},
{
"type": "null"
}
]
} }
} }
} }