mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Fix boostrap token encoding bug during master init
Currently the boostrap fails when a token is provided by the user on `master init` and works when the token is generated. This is because of a mismatch of how the token string in the kube-discovery secret is encoded.
This commit is contained in:
parent
0a68bb05ea
commit
5862ea6f38
@ -18,7 +18,6 @@ package master
|
||||
|
||||
import (
|
||||
"crypto/x509"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
@ -52,7 +51,7 @@ func encodeKubeDiscoverySecretData(s *kubeadmapi.KubeadmConfig, caCert *x509.Cer
|
||||
endpointList = append(endpointList, fmt.Sprintf("https://%s:443", addr.String()))
|
||||
}
|
||||
|
||||
tokenMap[s.Secrets.TokenID] = hex.EncodeToString(s.Secrets.Token)
|
||||
tokenMap[s.Secrets.TokenID] = s.Secrets.BearerToken
|
||||
|
||||
data["endpoint-list.json"], _ = json.Marshal(endpointList)
|
||||
data["token-map.json"], _ = json.Marshal(tokenMap)
|
||||
|
Loading…
Reference in New Issue
Block a user