From 5862ea6f385c53803176ea9d45a4bdbc5eb547da Mon Sep 17 00:00:00 2001 From: Atanas Mirchev Date: Fri, 23 Sep 2016 17:26:08 +0200 Subject: [PATCH] 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. --- cmd/kubeadm/app/master/discovery.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/kubeadm/app/master/discovery.go b/cmd/kubeadm/app/master/discovery.go index 2afec6193a8..54401ef1ae6 100644 --- a/cmd/kubeadm/app/master/discovery.go +++ b/cmd/kubeadm/app/master/discovery.go @@ -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)