Skip to content

Commit

Permalink
Fix #211: incorrect conversion between integer types
Browse files Browse the repository at this point in the history
  • Loading branch information
roivaz committed Feb 5, 2024
1 parent 11abb22 commit 08ce778
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/initmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func parseBindAddress(address string) (string, uint32, error) {

var err error
var host string
var port int
var port int64

var parts []string
if parts = strings.Split(address, ":"); len(parts) != 2 {
Expand All @@ -186,7 +186,7 @@ func parseBindAddress(address string) (string, uint32, error) {
return "", 0, err
}

if port, err = strconv.Atoi(parts[1]); err != nil {
if port, err = strconv.ParseInt(parts[1], 10, 32); err != nil {
return "", 0, fmt.Errorf("unable to parse port value in 'spec.envoyStaticConfig.adminBindAddress'")
}

Expand Down

0 comments on commit 08ce778

Please sign in to comment.