File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ func (s portMapSorter) Less(i, j int) bool {
5858func SortPortMap (ports []Port , bindings PortMap ) {
5959 s := portMapSorter {}
6060 for _ , p := range ports {
61- if binding , ok := bindings [p ]; ok {
61+ if binding , ok := bindings [p ]; ok && len ( binding ) > 0 {
6262 for _ , b := range binding {
6363 s = append (s , portMapEntry {port : p , binding : b })
6464 }
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ func TestSortPortMap(t *testing.T) {
4646 Port ("22/tcp" ),
4747 Port ("22/udp" ),
4848 Port ("8000/tcp" ),
49+ Port ("8443/tcp" ),
4950 Port ("6379/tcp" ),
5051 Port ("9999/tcp" ),
5152 }
@@ -57,6 +58,7 @@ func TestSortPortMap(t *testing.T) {
5758 Port ("8000/tcp" ): []PortBinding {
5859 {},
5960 },
61+ Port ("8443/tcp" ): []PortBinding {},
6062 Port ("6379/tcp" ): []PortBinding {
6163 {},
6264 {HostIP : "0.0.0.0" , HostPort : "32749" },
@@ -70,6 +72,7 @@ func TestSortPortMap(t *testing.T) {
7072 if ! reflect .DeepEqual (ports , []Port {
7173 Port ("9999/tcp" ),
7274 Port ("6379/tcp" ),
75+ Port ("8443/tcp" ),
7376 Port ("8000/tcp" ),
7477 Port ("22/tcp" ),
7578 Port ("22/udp" ),
You can’t perform that action at this time.
0 commit comments