mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 18:54:06 +00:00
Merge pull request #121230 from SataQiu/fix-kubeadm-20231014
kubeadm: fill with the DefaultCRISocket when CRI socket detection is not required
This commit is contained in:
commit
afc302c2d2
@ -223,9 +223,6 @@ func getDefaultNodeConfigBytes() ([]byte, error) {
|
||||
UnsafeSkipCAVerification: true, // TODO: UnsafeSkipCAVerification: true needs to be set for validation to pass, but shouldn't be recommended as the default
|
||||
},
|
||||
},
|
||||
NodeRegistration: kubeadmapiv1old.NodeRegistrationOptions{
|
||||
CRISocket: constants.DefaultCRISocket, // avoid CRI detection
|
||||
},
|
||||
}, opts)
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
@ -238,9 +235,7 @@ func getDefaultResetConfigBytes() ([]byte, error) {
|
||||
opts := configutil.LoadOrDefaultConfigurationOptions{
|
||||
SkipCRIDetect: true,
|
||||
}
|
||||
internalcfg, err := configutil.DefaultedResetConfiguration(&kubeadmapiv1.ResetConfiguration{
|
||||
CRISocket: constants.DefaultCRISocket, // avoid CRI detection
|
||||
}, opts)
|
||||
internalcfg, err := configutil.DefaultedResetConfiguration(&kubeadmapiv1.ResetConfiguration{}, opts)
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
|
@ -111,8 +111,8 @@ func SetNodeRegistrationDynamicDefaults(cfg *kubeadmapi.NodeRegistrationOptions,
|
||||
|
||||
if cfg.CRISocket == "" {
|
||||
if skipCRIDetect {
|
||||
klog.V(4).Infof("skip CRI socket detection, fill with placeholder %s", kubeadmconstants.UnknownCRISocket)
|
||||
cfg.CRISocket = kubeadmconstants.UnknownCRISocket // set a value to pass the ValidateSocketPath
|
||||
klog.V(4).Infof("skip CRI socket detection, fill with the default CRI socket %s", kubeadmconstants.DefaultCRISocket)
|
||||
cfg.CRISocket = kubeadmconstants.DefaultCRISocket
|
||||
return nil
|
||||
}
|
||||
cfg.CRISocket, err = kubeadmruntime.DetectCRISocket()
|
||||
|
@ -40,8 +40,8 @@ func SetResetDynamicDefaults(cfg *kubeadmapi.ResetConfiguration, skipCRIDetect b
|
||||
var err error
|
||||
if cfg.CRISocket == "" {
|
||||
if skipCRIDetect {
|
||||
klog.V(4).Infof("skip CRI socket detection, fill with placeholder %s", constants.UnknownCRISocket)
|
||||
cfg.CRISocket = constants.UnknownCRISocket // set a value to pass the ValidateSocketPath
|
||||
klog.V(4).Infof("skip CRI socket detection, fill with the default CRI socket %s", constants.DefaultCRISocket)
|
||||
cfg.CRISocket = constants.DefaultCRISocket
|
||||
return nil
|
||||
}
|
||||
cfg.CRISocket, err = kubeadmruntime.DetectCRISocket()
|
||||
|
Loading…
Reference in New Issue
Block a user