Skip to content

Commit

Permalink
Merge pull request labring#619 from oldthreefeng/develop
Browse files Browse the repository at this point in the history
fix decode miss cakey
  • Loading branch information
oldthreefeng authored Apr 10, 2021
2 parents d2609b2 + 1b60955 commit 4db4953
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@
COMMIT_SHA1=$(git rev-parse --short HEAD || echo "0.0.0")
BUILD_TIME=$(date "+%F %T")
goldflags="-s -w -X 'github.com/linuxsuren/cobra-extension/version.version=$1' -X 'github.com/linuxsuren/cobra-extension/version.commit=${COMMIT_SHA1}' -X 'github.com/linuxsuren/cobra-extension/version.date=${BUILD_TIME}'"
go build -o sealos -ldflags "$goldflags" main.go && command -v upx &> /dev/null && upx sealos
go build -o sealos -ldflags "$goldflags" main.go && command -v upx &> /dev/null && upx sealos
19 changes: 15 additions & 4 deletions install/sealos.go
Original file line number Diff line number Diff line change
@@ -117,12 +117,23 @@ func decodeJoinCmd(cmd string) {
r = strings.ReplaceAll(r, "\\", "")
r = strings.TrimSpace(r)
logger.Debug("[####]%d :%s:", i, r)
switch r {
case "--token":
// switch r {
// case "--token":
// JoinToken = stringSlice[i+1]
// case "--discovery-token-ca-cert-hash":
// TokenCaCertHash = stringSlice[i+1]
// case "--certificate-key":
// CertificateKey = stringSlice[i+1][:64]
// }
if strings.Contains(r, "--token") {
JoinToken = stringSlice[i+1]
case "--discovery-token-ca-cert-hash":
}

if strings.Contains(r, "--discovery-token-ca-cert-hash") {
TokenCaCertHash = stringSlice[i+1]
case "--certificate-key":
}

if strings.Contains(r, "--certificate-key") {
CertificateKey = stringSlice[i+1][:64]
}
}

0 comments on commit 4db4953

Please sign in to comment.