Skip to content

Commit

Permalink
Unmarshal ports given in integer format
Browse files Browse the repository at this point in the history
When docker-compose had a port number written in integer
format, while conversion, it was not being marshalled to
string format, added a type check which will do the int to
string conversion.

Fixes issue openshift#8859
  • Loading branch information
surajssd committed Jun 22, 2016
1 parent 58544a5 commit 461ce39
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package project
import (
"fmt"
"sort"
"strconv"
"strings"

"github.com/flynn/go-shlex"
Expand Down Expand Up @@ -299,6 +300,8 @@ func toSepMapParts(value map[interface{}]interface{}, sep string) ([]string, err
if sk, ok := k.(string); ok {
if sv, ok := v.(string); ok {
parts = append(parts, sk+sep+sv)
} else if sv, ok := v.(int); ok {
parts = append(parts, sk+sep+strconv.FormatInt(int64(sv), 10))
} else {
return nil, fmt.Errorf("Cannot unmarshal '%v' of type %T into a string value", v, v)
}
Expand Down

0 comments on commit 461ce39

Please sign in to comment.