@@ -95,7 +95,7 @@ func getJoinToken(ctx context.Context, baseURL, shortToken string) (*JoinCommand
9595
9696var joinCommand = & cli.Command {
9797 Name : "join" ,
98- Usage : "Join the current node to an existing cluster" ,
98+ Usage : fmt . Sprintf ( "Join the current node to a %s cluster" , binName ) ,
9999 ArgsUsage : "<url> <token>" ,
100100 Before : func (c * cli.Context ) error {
101101 if os .Getuid () != 0 {
@@ -104,20 +104,19 @@ var joinCommand = &cli.Command{
104104 return nil
105105 },
106106 Action : func (c * cli.Context ) error {
107- logrus .Debugf ("checking if %s is already installed" , defaults . BinaryName () )
107+ logrus .Debugf ("checking if %s is already installed" , binName )
108108 if installed , err := isAlreadyInstalled (); err != nil {
109109 return err
110110 } else if installed {
111111 logrus .Errorf ("An installation has been detected on this machine." )
112112 logrus .Infof ("If you want to reinstall you need to remove the existing installation" )
113113 logrus .Infof ("first. You can do this by running the following command:" )
114- logrus .Infof ("\n %s node reset \n " , defaults . BinaryName () )
114+ logrus .Infof ("\n sudo ./ %s uninstall \n " , binName )
115115 return ErrNothingElseToAdd
116116 }
117117
118- binname := defaults .BinaryName ()
119118 if c .Args ().Len () != 2 {
120- return fmt .Errorf ("usage: %s node join <url> <token>" , binname )
119+ return fmt .Errorf ("usage: %s node join <url> <token>" , binName )
121120 }
122121
123122 logrus .Infof ("Fetching join token remotely" )
@@ -127,7 +126,7 @@ var joinCommand = &cli.Command{
127126 }
128127
129128 metrics .ReportJoinStarted (c .Context , jcmd .MetricsBaseURL , jcmd .ClusterID )
130- logrus .Infof ("Materializing %s binaries" , binname )
129+ logrus .Infof ("Materializing %s binaries" , binName )
131130 if err := goods .Materialize (); err != nil {
132131 err := fmt .Errorf ("unable to materialize binaries: %w" , err )
133132 metrics .ReportJoinFailed (c .Context , jcmd .MetricsBaseURL , jcmd .ClusterID , err )
@@ -147,7 +146,7 @@ var joinCommand = &cli.Command{
147146 return err
148147 }
149148
150- logrus .Infof ("Installing %s binaries" , binname )
149+ logrus .Infof ("Installing %s binaries" , binName )
151150 if err := installK0sBinary (); err != nil {
152151 err := fmt .Errorf ("unable to install k0s binary: %w" , err )
153152 metrics .ReportJoinFailed (c .Context , jcmd .MetricsBaseURL , jcmd .ClusterID , err )
@@ -175,7 +174,7 @@ var joinCommand = &cli.Command{
175174 return err
176175 }
177176
178- logrus .Infof ("Starting %s service" , binname )
177+ logrus .Infof ("Starting %s service" , binName )
179178 if err := startK0sService (); err != nil {
180179 err := fmt .Errorf ("unable to start service: %w" , err )
181180 metrics .ReportJoinFailed (c .Context , jcmd .MetricsBaseURL , jcmd .ClusterID , err )
0 commit comments