vendor in latests containers/common

To include export HostContainersInternal

Signed-off-by: Black-Hole1 <bh@bugs.cc>
This commit is contained in:
Black-Hole1
2023-06-21 15:05:14 +08:00
parent a77f896bab
commit ae6e390760
21 changed files with 124 additions and 100 deletions

View File

@@ -34,3 +34,21 @@ func ParseVlan(vlan string) (int, error) {
}
return v, nil
}
// ParseIsolate parses the isolate option
func ParseIsolate(isolate string) (string, error) {
switch isolate {
case "":
return "false", nil
case "strict":
return isolate, nil
default:
// isolate option accepts "strict" and Rust boolean values "true" or "false"
optIsolateBool, err := strconv.ParseBool(isolate)
if err != nil {
return "", fmt.Errorf("failed to parse isolate option: %w", err)
}
// Rust boolean only support "true" or "false" while go can parse 1 and 0 as well so we need to change it
return strconv.FormatBool(optIsolateBool), nil
}
}