mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 00:31:00 +00:00
Merge pull request #111531 from clementnuss/kubeadm-fqdn-fix-master
Fix `kubeadm upgrade plan` issue with FQDN nodes names
This commit is contained in:
commit
3c1237930e
@ -232,9 +232,14 @@ func enforceRequirements(flags *applyPlanFlags, args []string, dryRun bool, upgr
|
|||||||
if dupURLScheme {
|
if dupURLScheme {
|
||||||
socket := strings.ReplaceAll(cfg.NodeRegistration.CRISocket, kubeadmapiv1.DefaultContainerRuntimeURLScheme+"://", "")
|
socket := strings.ReplaceAll(cfg.NodeRegistration.CRISocket, kubeadmapiv1.DefaultContainerRuntimeURLScheme+"://", "")
|
||||||
cfg.NodeRegistration.CRISocket = kubeadmapiv1.DefaultContainerRuntimeURLScheme + "://" + socket
|
cfg.NodeRegistration.CRISocket = kubeadmapiv1.DefaultContainerRuntimeURLScheme + "://" + socket
|
||||||
hostname, err := os.Hostname()
|
var hostname string
|
||||||
if err != nil {
|
if len(cfg.NodeRegistration.Name) > 0 {
|
||||||
return nil, nil, nil, errors.Wrapf(err, "failed to get hostname")
|
hostname = cfg.NodeRegistration.Name
|
||||||
|
} else {
|
||||||
|
hostname, err = os.Hostname()
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, nil, errors.Wrapf(err, "failed to get hostname")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
klog.V(2).Infof("ensuring that Node %q has a CRI socket annotation with correct URL scheme %q", hostname, cfg.NodeRegistration.CRISocket)
|
klog.V(2).Infof("ensuring that Node %q has a CRI socket annotation with correct URL scheme %q", hostname, cfg.NodeRegistration.CRISocket)
|
||||||
if err := patchnodephase.AnnotateCRISocket(client, hostname, cfg.NodeRegistration.CRISocket); err != nil {
|
if err := patchnodephase.AnnotateCRISocket(client, hostname, cfg.NodeRegistration.CRISocket); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user