kubeadm: print the CA of kubeconfig files in "check expiration"

Apply a small fix to ensure the kubeconfig files
that kubeadm manages have a CA when printed in the table
of the "check expiration" command. "CAName" is the field used for that.

In practice kubeconfig files can contain multiple credentials
from different CAs, but this is not supported by kubeadm and there
is a single cluster CA that signs the single client cert/key
in kubeadm managed kubeconfigs.
This commit is contained in:
Lubomir I. Ivanov 2021-12-08 20:50:23 +02:00
parent 6603cf6357
commit c78afc695b

View File

@ -166,6 +166,7 @@ func NewManager(cfg *kubeadmapi.ClusterConfiguration, kubernetesDir string) (*Ma
LongName: kubeConfig.longName,
FileName: kubeConfig.fileName,
CABaseName: kubeadmconstants.CACertAndKeyBaseName, // all certificates in kubeConfig files are signed by the Kubernetes CA
CAName: kubeadmconstants.CACertAndKeyBaseName,
readwriter: kubeConfigReadWriter,
}
}