From bfcbe584e46ed56b6975b924e342ec9b5b5691b4 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 22 May 2017 10:35:21 -0700 Subject: [PATCH] config-linux: Forbid the empty string for mountLabel minLength is documented in [1]. The spec is currently not clear about how values for this property should be used, and after this commit it is still not clear. But the Linux.MountLabel property is not a *string, so distinguishing between "unset" and "set to the empty string" would be awkward in Go. I'm not familiar enough with the backing kernel API to be able to put RFC 2119 teeth into how the value should be used, but I'm pretty sure we either want this commit (forbidding the empty string) or a *string in the Go type. [1]: https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7 Signed-off-by: W. Trevor King --- config-linux.md | 1 + schema/config-linux.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config-linux.md b/config-linux.md index 7adadba62..7647cbc1a 100644 --- a/config-linux.md +++ b/config-linux.md @@ -642,6 +642,7 @@ The values MUST be absolute paths in the [container namespace](glossary.md#conta ## Mount Label **`mountLabel`** (string, OPTIONAL) will set the Selinux context for the mounts in the container. + The value MUST NOT be an empty string. ### Example diff --git a/schema/config-linux.json b/schema/config-linux.json index dd5bac013..1dc8c23db 100644 --- a/schema/config-linux.json +++ b/schema/config-linux.json @@ -264,7 +264,8 @@ }, "mountLabel": { "id": "https://opencontainers.org/schema/bundle/linux/mountLabel", - "type": "string" + "type": "string", + "minLength": 1 } } }