@@ -59,7 +59,8 @@ func FetchInitConfigurationFromCluster(client clientset.Interface, printer outpu
59
59
}
60
60
61
61
// Apply dynamic defaults
62
- if err := SetInitDynamicDefaults (cfg , false ); err != nil {
62
+ // NB. skip CRI detection here because it won't be used at all and will be overridden later
63
+ if err := SetInitDynamicDefaults (cfg , true ); err != nil {
63
64
return nil , err
64
65
}
65
66
@@ -116,15 +117,6 @@ func getInitConfigurationFromCluster(kubeconfigDir string, client clientset.Inte
116
117
if err := getAPIEndpoint (client , initcfg .NodeRegistration .Name , & initcfg .LocalAPIEndpoint ); err != nil {
117
118
return nil , errors .Wrap (err , "failed to getAPIEndpoint" )
118
119
}
119
- } else {
120
- // In the case where newControlPlane is true we don't go through getNodeRegistration() and initcfg.NodeRegistration.CRISocket is empty.
121
- // This forces DetectCRISocket() to be called later on, and if there is more than one CRI installed on the system, it will error out,
122
- // while asking for the user to provide an override for the CRI socket. Even if the user provides an override, the call to
123
- // DetectCRISocket() can happen too early and thus ignore it (while still erroring out).
124
- // However, if newControlPlane == true, initcfg.NodeRegistration is not used at all and it's overwritten later on.
125
- // Thus it's necessary to supply some default value, that will avoid the call to DetectCRISocket() and as
126
- // initcfg.NodeRegistration is discarded, setting whatever value here is harmless.
127
- initcfg .NodeRegistration .CRISocket = constants .UnknownCRISocket
128
120
}
129
121
return initcfg , nil
130
122
}
0 commit comments