diff --git a/pkg/helmvm/jointoken.go b/pkg/helmvm/jointoken.go deleted file mode 100644 index d723f6f015..0000000000 --- a/pkg/helmvm/jointoken.go +++ /dev/null @@ -1,25 +0,0 @@ -package helmvm - -import ( - "encoding/base64" - "encoding/json" - - "github.com/google/uuid" -) - -// joinToken is a struct that holds both the actual token and the cluster id. This is marshaled -// and base64 encoded and used as argument to the join command in the other nodes. -type joinToken struct { - ClusterID uuid.UUID `json:"clusterID"` - Token string `json:"token"` - Role string `json:"role"` -} - -// Encode encodes a JoinToken to base64. -func (j *joinToken) Encode() (string, error) { - b, err := json.Marshal(j) - if err != nil { - return "", err - } - return base64.StdEncoding.EncodeToString(b), nil -} diff --git a/pkg/helmvm/node_join.go b/pkg/helmvm/node_join.go index aa6544f044..4c98ef0034 100644 --- a/pkg/helmvm/node_join.go +++ b/pkg/helmvm/node_join.go @@ -228,7 +228,7 @@ func GenerateAddNodeCommand(ctx context.Context, client kubernetes.Interface, to return "", fmt.Errorf("failed to get admin console port: %w", err) } - return fmt.Sprintf("%s node join %s:%d %s", binaryName, nodeIP, port, token), nil + return fmt.Sprintf("sudo ./%s node join %s:%d %s", binaryName, nodeIP, port, token), nil } // GenerateK0sJoinCommand returns the k0s node join command, without the token but with all other required flags