mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
ecf73148cb
If the timeout value was zero, the hook would always error, and there doesn't seem to be much point to that. And I'm not sure what negative timeouts would mean. By adding this restriction, we do not limit useful hook entries, and we give the validation code grounds to warn users attempting to validate configs which are poorly defined or have useless hook entries. I'd like to remove the pointer from the Go type to comply with our anti-pointer zero-value style (style.md) now that Go's zero-value is clearly invalid. However, there has been maintainer resistance to removing the pointer [1] (although I don't think this is consistent with previous maintainer statements that we don't need pointers when the zero value is invalid [2]). In order to land the normative spec change, this commit keeps the current *int for Hook.Timeout and punts a consistent policy to future work. [1]: https://github.com/opencontainers/runtime-spec/pull/764#discussion_r111607155 [2]: https://github.com/opencontainers/runtime-spec/pull/653#issuecomment-272253010 Signed-off-by: W. Trevor King <wking@tremily.us>
156 lines
4.0 KiB
JSON
156 lines
4.0 KiB
JSON
{
|
|
"description": "Definitions used throughout the Open Container Runtime Specification",
|
|
"definitions": {
|
|
"int8": {
|
|
"type": "integer",
|
|
"minimum": -128,
|
|
"maximum": 127
|
|
},
|
|
"int16": {
|
|
"type": "integer",
|
|
"minimum": -32768,
|
|
"maximum": 32767
|
|
},
|
|
"int32": {
|
|
"type": "integer",
|
|
"minimum": -2147483648,
|
|
"maximum": 2147483647
|
|
},
|
|
"int64": {
|
|
"type": "integer",
|
|
"minimum": -9223372036854776000,
|
|
"maximum": 9223372036854776000
|
|
},
|
|
"uint8": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 255
|
|
},
|
|
"uint16": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 65535
|
|
},
|
|
"uint32": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 4294967295
|
|
},
|
|
"uint64": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 18446744073709552000
|
|
},
|
|
"percent": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 100
|
|
},
|
|
"mapStringString": {
|
|
"type": "object",
|
|
"patternProperties": {
|
|
".{1,}": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"UID": {
|
|
"$ref": "#/definitions/uint32"
|
|
},
|
|
"GID": {
|
|
"$ref": "#/definitions/uint32"
|
|
},
|
|
"ArrayOfGIDs": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/GID"
|
|
}
|
|
},
|
|
"ArrayOfStrings": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"FilePath": {
|
|
"type": "string"
|
|
},
|
|
"Env": {
|
|
"$ref": "#/definitions/ArrayOfStrings"
|
|
},
|
|
"Hook": {
|
|
"type": "object",
|
|
"properties": {
|
|
"path": {
|
|
"$ref": "#/definitions/FilePath"
|
|
},
|
|
"args": {
|
|
"$ref": "#/definitions/ArrayOfStrings"
|
|
},
|
|
"env": {
|
|
"$ref": "#/definitions/Env"
|
|
},
|
|
"timeout": {
|
|
"type": "integer",
|
|
"minimum": 1
|
|
}
|
|
},
|
|
"required": [
|
|
"path"
|
|
]
|
|
},
|
|
"ArrayOfHooks": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Hook"
|
|
}
|
|
},
|
|
"IDMapping": {
|
|
"type": "object",
|
|
"properties": {
|
|
"hostID": {
|
|
"$ref": "#/definitions/uint32"
|
|
},
|
|
"containerID": {
|
|
"$ref": "#/definitions/uint32"
|
|
},
|
|
"size": {
|
|
"$ref": "#/definitions/uint32"
|
|
}
|
|
},
|
|
"required": [
|
|
"hostID",
|
|
"containerID",
|
|
"size"
|
|
]
|
|
},
|
|
"Mount": {
|
|
"type": "object",
|
|
"properties": {
|
|
"source": {
|
|
"$ref": "#/definitions/FilePath"
|
|
},
|
|
"destination": {
|
|
"$ref": "#/definitions/FilePath"
|
|
},
|
|
"options": {
|
|
"$ref": "#/definitions/ArrayOfStrings"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"destination"
|
|
]
|
|
},
|
|
"ociVersion": {
|
|
"description": "The version of Open Container Runtime Specification that the document complies with",
|
|
"type": "string"
|
|
},
|
|
"annotations": {
|
|
"$ref": "#/definitions/mapStringString"
|
|
}
|
|
}
|
|
}
|