Skip to content

Commit 311af36

Browse files
committed
bug fix
1 parent a47d81a commit 311af36

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

install/sealos.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,18 @@ func (s *SealosInstaller) JoinNodes() {
8686
func (s *SealosInstaller) decodeOutput(output []byte) {
8787
s0 := string(output)
8888
slice := strings.Split(s0, "kubeadm join")
89-
slice1 := strings.Split(slice[1], "\n")
90-
slice1[0] += "kubeadm join "
91-
fmt.Println(" join command is: %s", slice1[0])
89+
slice1 := strings.Split(slice[1], "\n\n")
90+
fmt.Println(" join command is: ", slice1[0])
9291
s.decodeJoinCmd(slice1[0])
9392
}
9493

95-
// kubeadm join 192.168.0.200:6443 --token 9vr73a.a8uxyaju799qwdjv --discovery-token-ca-cert-hash sha256:7c2e69131a36ae2a042a339b33381c6d0d43887e2de83720eff5359e26aec866 --experimental-control-plane --certificate-key f8902e114ef118304e561c3ecd4d0b543adc226b7a07f675f56564185ffe0c07
94+
// 192.168.0.200:6443 --token 9vr73a.a8uxyaju799qwdjv --discovery-token-ca-cert-hash sha256:7c2e69131a36ae2a042a339b33381c6d0d43887e2de83720eff5359e26aec866 --experimental-control-plane --certificate-key f8902e114ef118304e561c3ecd4d0b543adc226b7a07f675f56564185ffe0c07
9695
func (s *SealosInstaller) decodeJoinCmd(cmd string) {
9796
stringSlice := strings.Split(cmd, " ")
9897
if len(stringSlice) == 10 {
99-
s.JoinToken = stringSlice[4]
100-
s.TokenCaCertHash = stringSlice[6]
101-
s.CertificateKey = stringSlice[9]
98+
s.JoinToken = stringSlice[2]
99+
s.TokenCaCertHash = stringSlice[4]
100+
s.CertificateKey = stringSlice[7]
102101

103102
fmt.Println("sealos config %v", *s)
104103
} else {

0 commit comments

Comments
 (0)