@@ -79,27 +79,38 @@ func getMetadataList(image pkgutil.Image) ([]string, error) {
79
79
return nil , err
80
80
}
81
81
c := configFile .Config
82
+
82
83
return []string {
83
84
fmt .Sprintf ("Domainname: %s" , c .Domainname ),
84
85
fmt .Sprintf ("User: %s" , c .User ),
85
86
fmt .Sprintf ("AttachStdin: %t" , c .AttachStdin ),
86
87
fmt .Sprintf ("AttachStdout: %t" , c .AttachStdout ),
87
88
fmt .Sprintf ("AttachStderr: %t" , c .AttachStderr ),
88
- fmt .Sprintf ("ExposedPorts: %v" , pkgutil .SortMap (c .ExposedPorts )),
89
+ fmt .Sprintf ("ExposedPorts: %v" , pkgutil .SortMap (StructMapToStringMap ( c .ExposedPorts ) )),
89
90
fmt .Sprintf ("Tty: %t" , c .Tty ),
90
91
fmt .Sprintf ("OpenStdin: %t" , c .OpenStdin ),
91
92
fmt .Sprintf ("StdinOnce: %t" , c .StdinOnce ),
92
93
fmt .Sprintf ("Env: %s" , strings .Join (c .Env , "," )),
93
94
fmt .Sprintf ("Cmd: %s" , strings .Join (c .Cmd , "," )),
94
95
fmt .Sprintf ("ArgsEscaped: %t" , c .ArgsEscaped ),
95
- fmt .Sprintf ("Volumes: %v" , pkgutil .SortMap (c .Volumes )),
96
+ fmt .Sprintf ("Volumes: %v" , pkgutil .SortMap (StructMapToStringMap ( c .Volumes ) )),
96
97
fmt .Sprintf ("Workdir: %s" , c .WorkingDir ),
97
98
fmt .Sprintf ("Entrypoint: %s" , strings .Join (c .Entrypoint , "," )),
98
99
fmt .Sprintf ("NetworkDisabled: %t" , c .NetworkDisabled ),
99
100
fmt .Sprintf ("MacAddress: %s" , c .MacAddress ),
100
101
fmt .Sprintf ("OnBuild: %s" , strings .Join (c .OnBuild , "," )),
101
- fmt .Sprintf ("Labels: %v" , c .Labels ),
102
+ fmt .Sprintf ("Labels: %v" , pkgutil . SortMap ( c .Labels ) ),
102
103
fmt .Sprintf ("StopSignal: %s" , c .StopSignal ),
103
104
fmt .Sprintf ("Shell: %s" , strings .Join (c .Shell , "," )),
104
105
}, nil
105
106
}
107
+
108
+ // StructMapToStringMap converts map[string]struct{} to map[string]string knowing that the
109
+ // struct in the value is always empty
110
+ func StructMapToStringMap (m map [string ]struct {}) map [string ]string {
111
+ newMap := make (map [string ]string )
112
+ for k := range m {
113
+ newMap [k ] = fmt .Sprintf ("%s" , m [k ])
114
+ }
115
+ return newMap
116
+ }
0 commit comments