Unverified Commit 5862ea6f authored by Atanas Mirchev's avatar Atanas Mirchev Committed by Ilya Dmitrichenko

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.
parent 0a68bb05
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment