mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Optimized the indentation of codes and fix two typos
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
This commit is contained in:
parent
8cced87022
commit
a9b6319e67
1 changed files with 22 additions and 21 deletions
|
@ -160,7 +160,9 @@ func parseSecurityOpt(container *container.Container, config *containertypes.Hos
|
|||
for _, opt := range config.SecurityOpt {
|
||||
if opt == "no-new-privileges" {
|
||||
container.NoNewPrivileges = true
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
|
||||
var con []string
|
||||
if strings.Contains(opt, "=") {
|
||||
con = strings.SplitN(opt, "=", 2)
|
||||
|
@ -170,7 +172,7 @@ func parseSecurityOpt(container *container.Container, config *containertypes.Hos
|
|||
}
|
||||
|
||||
if len(con) != 2 {
|
||||
return fmt.Errorf("Invalid --security-opt 1: %q", opt)
|
||||
return fmt.Errorf("invalid --security-opt 1: %q", opt)
|
||||
}
|
||||
|
||||
switch con[0] {
|
||||
|
@ -181,8 +183,7 @@ func parseSecurityOpt(container *container.Container, config *containertypes.Hos
|
|||
case "seccomp":
|
||||
container.SeccompProfile = con[1]
|
||||
default:
|
||||
return fmt.Errorf("Invalid --security-opt 2: %q", opt)
|
||||
}
|
||||
return fmt.Errorf("invalid --security-opt 2: %q", opt)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue