Support `none` as capabilities.
@@ -309,7 +309,11 @@ func ConfigInspectToOCI(image *MobyImage, inspect types.ImageInspect) ([]byte, e
namespaces = append(namespaces, specs.LinuxNamespace{Type: specs.MountNamespace})
caps := image.Capabilities
- if len(caps) == 1 && strings.ToLower(caps[0]) == "all" {
+ if len(caps) == 1 {
+ switch cap := strings.ToLower(caps[0]); cap {
+ case "none":
+ caps = []string{}
+ case "all":
caps = []string{
"CAP_AUDIT_CONTROL",
"CAP_AUDIT_READ",
@@ -351,6 +355,7 @@ func ConfigInspectToOCI(image *MobyImage, inspect types.ImageInspect) ([]byte, e
"CAP_WAKE_ALARM",
}
}
+ }
oci.Version = specs.Version
