From 9de0b2bf4694c00dbe65d2b70110fef3c8374547 Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Mon, 8 Feb 2021 17:20:43 +0100 Subject: [PATCH] kubeadm: flatten admin.conf for cluster-info --- .../app/phases/bootstraptoken/clusterinfo/clusterinfo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo/clusterinfo.go b/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo/clusterinfo.go index 5f6c27e3d8c..80658726d40 100644 --- a/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo/clusterinfo.go +++ b/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo/clusterinfo.go @@ -47,6 +47,9 @@ func CreateBootstrapConfigMapIfNotExists(client clientset.Interface, file string if err != nil { return errors.Wrap(err, "failed to load admin kubeconfig") } + if err = clientcmdapi.FlattenConfig(adminConfig); err != nil { + return err + } adminCluster := adminConfig.Contexts[adminConfig.CurrentContext].Cluster // Copy the cluster from admin.conf to the bootstrap kubeconfig, contains the CA cert and the server URL