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:
Atanas Mirchev
2016-09-23 17:26:08 +02:00
committed by Ilya Dmitrichenko
parent 0a68bb05ea
commit 5862ea6f38

View File

@@ -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)