Skip to content

Commit

Permalink
Fix: Wrong agent start-join parameter check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Luis Lucas committed Jun 20, 2019
1 parent c0eb668 commit 3971e9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func runAgent(cmd *cobra.Command, args []string) error {
var err error

gossipStartJoin, _ := cmd.Flags().GetStringSlice("start-join")
err = urlParse(gossipStartJoin...)
err = urlParseNoSchemaRequired(gossipStartJoin...)
if err != nil {
return err
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const (
errUnexpectedScheme = "unexpected URL Scheme"
)

// urlParse function checks that given string parameters are valid URLs for
// REST requests: schema + hostname [ + port ]
func urlParse(endpoints ...string) error {
for _, endpoint := range endpoints {
url, err := url.Parse(endpoint)
Expand All @@ -49,6 +51,8 @@ func urlParse(endpoints ...string) error {
return nil
}

// urlParse function checks that given string parameters are valid IPs for
// binding services: hostname + port. No schema is required.
func urlParseNoSchemaRequired(endpoints ...string) error {
for _, endpoint := range endpoints {

Expand Down

0 comments on commit 3971e9d

Please sign in to comment.