Skip to content

Commit

Permalink
Fix parsing of host field
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Aug 26, 2022
1 parent 0c77d99 commit c0a4833
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func MakeInstall() *cobra.Command {
command.Flags().String("user", "root", "Username for SSH login")

command.Flags().String("host", "", "Public hostname of node on which to install agent")
command.Flags().String("host-ip", "", "Public hostname of an existing k3s server")

command.Flags().String("ssh-key", "~/.ssh/id_rsa", "The ssh key to use for remote login")
command.Flags().Int("ssh-port", 22, "The port on which to connect for ssh")
Expand Down Expand Up @@ -124,12 +123,7 @@ Provide the --local-path flag with --merge if a kubeconfig already exists in som
}

if !local {
_, err := command.Flags().GetIP("ip")
if err != nil {
return err
}

_, err = command.Flags().GetIP("host")
_, err = command.Flags().GetString("host")
if err != nil {
return err
}
Expand Down Expand Up @@ -198,13 +192,15 @@ Provide the --local-path flag with --merge if a kubeconfig already exists in som
if err != nil {
return err
}

host, err := command.Flags().GetString("host")
if err != nil {
return err
}
if len(host) == 0 {
host = ip.String()
}

log.Println(host)

cluster, _ := command.Flags().GetBool("cluster")
Expand Down

0 comments on commit c0a4833

Please sign in to comment.