Skip to content
This repository was archived by the owner on Dec 17, 2021. It is now read-only.

Commit 172c3af

Browse files
committed
commands/create: Remove func validateSwarmDiscovery
1 parent 48253e2 commit 172c3af

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

commands/create.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"os"
88
"path/filepath"
9-
"regexp"
109
"sort"
1110
"strings"
1211

@@ -59,10 +58,6 @@ func cmdCreateInner(c CommandLine, api libmachine.API) error {
5958
return fmt.Errorf("Error creating machine: %s", mcnerror.ErrInvalidHostname)
6059
}
6160

62-
if err := validateSwarmDiscovery(c.String("swarm-discovery")); err != nil {
63-
return fmt.Errorf("Error parsing swarm discovery: %s", err)
64-
}
65-
6661
// TODO: Fix hacky JSON solution
6762
rawDriver, err := json.Marshal(&drivers.BaseDriver{
6863
MachineName: name,
@@ -332,23 +327,6 @@ func addDriverFlagsToCommand(cliFlags []cli.Flag, cmd *cli.Command) *cli.Command
332327
return cmd
333328
}
334329

335-
func validateSwarmDiscovery(discovery string) error {
336-
if discovery == "" {
337-
return nil
338-
}
339-
340-
matched, err := regexp.MatchString(`[^:]*://.*`, discovery)
341-
if err != nil {
342-
return err
343-
}
344-
345-
if matched {
346-
return nil
347-
}
348-
349-
return fmt.Errorf("Swarm Discovery URL was in the wrong format: %s", discovery)
350-
}
351-
352330
func tlsPath(c CommandLine, flag string, defaultName string) string {
353331
path := c.GlobalString(flag)
354332
if path != "" {

0 commit comments

Comments
 (0)