From 4a3b990bbe8eb07b12ff87a5d7bbbc2caf831989 Mon Sep 17 00:00:00 2001 From: Akihito INOH Date: Thu, 24 Jan 2019 08:40:58 +0900 Subject: [PATCH] Change to [bootstrap-token] in kubeadm output In output of "kubeadm init", there are two strings for meaning of bootstrap token which are "bootstraptoken" and "bootstrap-token". This changes `[bootstraptoken]` to `[bootstrap-token]`. --- .../app/phases/bootstraptoken/clusterinfo/clusterinfo.go | 8 ++++---- .../app/phases/bootstraptoken/node/tlsbootstrap.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo/clusterinfo.go b/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo/clusterinfo.go index f421251960..91502ec737 100644 --- a/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo/clusterinfo.go +++ b/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo/clusterinfo.go @@ -41,9 +41,9 @@ const ( // CreateBootstrapConfigMapIfNotExists creates the kube-public ConfigMap if it doesn't exist already func CreateBootstrapConfigMapIfNotExists(client clientset.Interface, file string) error { - fmt.Printf("[bootstraptoken] creating the %q ConfigMap in the %q namespace\n", bootstrapapi.ConfigMapClusterInfo, metav1.NamespacePublic) + fmt.Printf("[bootstrap-token] creating the %q ConfigMap in the %q namespace\n", bootstrapapi.ConfigMapClusterInfo, metav1.NamespacePublic) - klog.V(1).Infoln("[bootstraptoken] loading admin kubeconfig") + klog.V(1).Infoln("[bootstrap-token] loading admin kubeconfig") adminConfig, err := clientcmd.LoadFromFile(file) if err != nil { return errors.Wrap(err, "failed to load admin kubeconfig") @@ -51,7 +51,7 @@ func CreateBootstrapConfigMapIfNotExists(client clientset.Interface, file string adminCluster := adminConfig.Contexts[adminConfig.CurrentContext].Cluster // Copy the cluster from admin.conf to the bootstrap kubeconfig, contains the CA cert and the server URL - klog.V(1).Infoln("[bootstraptoken] copying the cluster from admin.conf to the bootstrap kubeconfig") + klog.V(1).Infoln("[bootstrap-token] copying the cluster from admin.conf to the bootstrap kubeconfig") bootstrapConfig := &clientcmdapi.Config{ Clusters: map[string]*clientcmdapi.Cluster{ "": adminConfig.Clusters[adminCluster], @@ -63,7 +63,7 @@ func CreateBootstrapConfigMapIfNotExists(client clientset.Interface, file string } // Create or update the ConfigMap in the kube-public namespace - klog.V(1).Infoln("[bootstraptoken] creating/updating ConfigMap in kube-public namespace") + klog.V(1).Infoln("[bootstrap-token] creating/updating ConfigMap in kube-public namespace") return apiclient.CreateOrUpdateConfigMap(client, &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: bootstrapapi.ConfigMapClusterInfo, diff --git a/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go b/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go index 334d6afdcc..293209a9a0 100644 --- a/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go +++ b/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go @@ -47,7 +47,7 @@ const ( // AllowBootstrapTokensToPostCSRs creates RBAC rules in a way the makes Node Bootstrap Tokens able to post CSRs func AllowBootstrapTokensToPostCSRs(client clientset.Interface) error { - fmt.Println("[bootstraptoken] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials") + fmt.Println("[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials") return apiclient.CreateOrUpdateClusterRoleBinding(client, &rbac.ClusterRoleBinding{ ObjectMeta: metav1.ObjectMeta{ @@ -69,7 +69,7 @@ func AllowBootstrapTokensToPostCSRs(client clientset.Interface) error { // AutoApproveNodeBootstrapTokens creates RBAC rules in a way that makes Node Bootstrap Tokens' CSR auto-approved by the csrapprover controller func AutoApproveNodeBootstrapTokens(client clientset.Interface) error { - fmt.Println("[bootstraptoken] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token") + fmt.Println("[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token") // Always create this kubeadm-specific binding though return apiclient.CreateOrUpdateClusterRoleBinding(client, &rbac.ClusterRoleBinding{ @@ -92,7 +92,7 @@ func AutoApproveNodeBootstrapTokens(client clientset.Interface) error { // AutoApproveNodeCertificateRotation creates RBAC rules in a way that makes Node certificate rotation CSR auto-approved by the csrapprover controller func AutoApproveNodeCertificateRotation(client clientset.Interface) error { - fmt.Println("[bootstraptoken] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster") + fmt.Println("[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster") return apiclient.CreateOrUpdateClusterRoleBinding(client, &rbac.ClusterRoleBinding{ ObjectMeta: metav1.ObjectMeta{