mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #98882 from kvaps/flatten-adminconfig
kubeadm: flatten admin.conf for cluster-info generation
This commit is contained in:
commit
0867767d6e
@ -47,6 +47,9 @@ func CreateBootstrapConfigMapIfNotExists(client clientset.Interface, file string
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to load admin kubeconfig")
|
return errors.Wrap(err, "failed to load admin kubeconfig")
|
||||||
}
|
}
|
||||||
|
if err = clientcmdapi.FlattenConfig(adminConfig); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
adminCluster := adminConfig.Contexts[adminConfig.CurrentContext].Cluster
|
adminCluster := adminConfig.Contexts[adminConfig.CurrentContext].Cluster
|
||||||
// Copy the cluster from admin.conf to the bootstrap kubeconfig, contains the CA cert and the server URL
|
// Copy the cluster from admin.conf to the bootstrap kubeconfig, contains the CA cert and the server URL
|
||||||
|
Loading…
Reference in New Issue
Block a user