Skip to content

Commit bfcbe58

Browse files
committed
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 <[email protected]>
1 parent fae0d09 commit bfcbe58

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

config-linux.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ The values MUST be absolute paths in the [container namespace](glossary.md#conta
642642
## <a name="configLinuxMountLabel" />Mount Label
643643

644644
**`mountLabel`** (string, OPTIONAL) will set the Selinux context for the mounts in the container.
645+
The value MUST NOT be an empty string.
645646

646647
### Example
647648

schema/config-linux.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@
264264
},
265265
"mountLabel": {
266266
"id": "https://opencontainers.org/schema/bundle/linux/mountLabel",
267-
"type": "string"
267+
"type": "string",
268+
"minLength": 1
268269
}
269270
}
270271
}

0 commit comments

Comments
 (0)