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:
Kubernetes Prow Robot 2023-10-16 06:45:18 +02:00 committed by GitHub
commit afc302c2d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 10 deletions

View File

@ -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
}

View File

@ -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()

View File

@ -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()