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:
20
vendor/github.com/docker/cli/opts/config.go
generated
vendored
20
vendor/github.com/docker/cli/opts/config.go
generated
vendored
@@ -40,25 +40,23 @@ func (o *ConfigOpt) 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.ConfigName = value
|
||||
options.ConfigName = 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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user