vendor: github.com/docker/cli v23.0.0

full diff: https://github.com/docker/cli/compare/v23.0.0-rc.1...v23.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2023-02-08 15:32:57 +01:00
parent 260117289b
commit 081447c9b1
26 changed files with 540 additions and 224 deletions

View File

@@ -40,25 +40,22 @@ func (o *SecretOpt) Set(value string) error {
}
for _, field := range fields {
parts := strings.SplitN(field, "=", 2)
key := strings.ToLower(parts[0])
if len(parts) != 2 {
key, val, ok := strings.Cut(field, "=")
if !ok || key == "" {
return fmt.Errorf("invalid field '%s' must be a key=value pair", field)
}
value := parts[1]
switch key {
// TODO(thaJeztah): these options should not be case-insensitive.
switch strings.ToLower(key) {
case "source", "src":
options.SecretName = value
options.SecretName = val
case "target":
options.File.Name = value
options.File.Name = val
case "uid":
options.File.UID = value
options.File.UID = val
case "gid":
options.File.GID = value
options.File.GID = val
case "mode":
m, err := strconv.ParseUint(value, 0, 32)
m, err := strconv.ParseUint(val, 0, 32)
if err != nil {
return fmt.Errorf("invalid mode specified: %v", err)
}