api: types: keep info.SecurityOptions a string slice

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-11-16 22:30:29 +01:00
parent 82804cc8e5
commit 123d33d81d
1 changed files with 13 additions and 8 deletions

View File

@ -172,16 +172,21 @@ func prettyPrintInfo(dockerCli *command.DockerCli, info types.Info) error {
fmt.Fprintf(dockerCli.Out(), "\n") fmt.Fprintf(dockerCli.Out(), "\n")
} }
if len(info.SecurityOptions) != 0 { if len(info.SecurityOptions) != 0 {
kvs, err := types.DecodeSecurityOptions(info.SecurityOptions)
if err != nil {
return err
}
fmt.Fprintf(dockerCli.Out(), "Security Options:\n") fmt.Fprintf(dockerCli.Out(), "Security Options:\n")
for _, o := range info.SecurityOptions { for _, so := range kvs {
switch o.Key { fmt.Fprintf(dockerCli.Out(), " %s\n", so.Name)
case "Name": for _, o := range so.Options {
fmt.Fprintf(dockerCli.Out(), " %s\n", o.Value) switch o.Key {
case "Profile": case "profile":
if o.Value != "default" { if o.Value != "default" {
fmt.Fprintf(dockerCli.Err(), " WARNING: You're not using the default seccomp profile\n") fmt.Fprintf(dockerCli.Err(), " WARNING: You're not using the default seccomp profile\n")
}
fmt.Fprintf(dockerCli.Out(), " Profile: %s\n", o.Value)
} }
fmt.Fprintf(dockerCli.Out(), " %s: %s\n", o.Key, o.Value)
} }
} }
} }