cluster.go (kubernetes-1.18.14) | : | cluster.go (kubernetes-1.18.15) | ||
---|---|---|---|---|
skipping to change at line 126 | skipping to change at line 126 | |||
return nil, errors.Wrap(err, "failed to getAPIEndpoint") | return nil, errors.Wrap(err, "failed to getAPIEndpoint") | |||
} | } | |||
} else { | } else { | |||
// In the case where newControlPlane is true we don't go through getNodeRegistration() and initcfg.NodeRegistration.CRISocket is empty. | // In the case where newControlPlane is true we don't go through getNodeRegistration() and initcfg.NodeRegistration.CRISocket is empty. | |||
// This forces DetectCRISocket() to be called later on, and if th ere is more than one CRI installed on the system, it will error out, | // This forces DetectCRISocket() to be called later on, and if th ere is more than one CRI installed on the system, it will error out, | |||
// while asking for the user to provide an override for the CRI s ocket. Even if the user provides an override, the call to | // while asking for the user to provide an override for the CRI s ocket. Even if the user provides an override, the call to | |||
// DetectCRISocket() can happen too early and thus ignore it (whi le still erroring out). | // DetectCRISocket() can happen too early and thus ignore it (whi le still erroring out). | |||
// However, if newControlPlane == true, initcfg.NodeRegistration is not used at all and it's overwritten later on. | // However, if newControlPlane == true, initcfg.NodeRegistration is not used at all and it's overwritten later on. | |||
// Thus it's necessary to supply some default value, that will av oid the call to DetectCRISocket() and as | // Thus it's necessary to supply some default value, that will av oid the call to DetectCRISocket() and as | |||
// initcfg.NodeRegistration is discarded, setting whatever value here is harmless. | // initcfg.NodeRegistration is discarded, setting whatever value here is harmless. | |||
initcfg.NodeRegistration.CRISocket = constants.DefaultDockerCRISo cket | initcfg.NodeRegistration.CRISocket = constants.UnknownCRISocket | |||
} | } | |||
return initcfg, nil | return initcfg, nil | |||
} | } | |||
// getNodeRegistration returns the nodeRegistration for the current node | // getNodeRegistration returns the nodeRegistration for the current node | |||
func getNodeRegistration(kubeconfigDir string, client clientset.Interface, nodeR egistration *kubeadmapi.NodeRegistrationOptions) error { | func getNodeRegistration(kubeconfigDir string, client clientset.Interface, nodeR egistration *kubeadmapi.NodeRegistrationOptions) error { | |||
// gets the name of the current node | // gets the name of the current node | |||
nodeName, err := getNodeNameFromKubeletConfig(kubeconfigDir) | nodeName, err := getNodeNameFromKubeletConfig(kubeconfigDir) | |||
if err != nil { | if err != nil { | |||
return errors.Wrap(err, "failed to get node name from kubelet con fig") | return errors.Wrap(err, "failed to get node name from kubelet con fig") | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |