Don't set bootstrap kubelet ip in case of UMN
We should not set bootstrap kubelet ip in case of user managed network (not sno)
as user can't set machine cidr and we can actually set wrong one and fail the installation
@@ -340,13 +340,17 @@ func (g *installerGenerator) Generate(ctx context.Context, installConfig []byte,
}
// setting bootstrap kubelet node ip
+ // We don't want to set bootstrap ip in None platform as user can't set machine cidr
+ //and we can choose the wrong one
log.Debugf("Adding bootstrap ip to env vars")
+ if !swag.BoolValue(g.cluster.UserManagedNetworking) || common.IsSingleNodeCluster(g.cluster) {
bootstrapIp, errB := network.GetPrimaryMachineCIDRIP(common.GetBootstrapHost(g.cluster), g.cluster)
if errB != nil {
log.WithError(errB).Warn("Failed to get bootstrap primary ip for kubelet service update.")
return errB
}
envVars = append(envVars, "OPENSHIFT_INSTALL_BOOTSTRAP_NODE_IP="+bootstrapIp)
+ }
// write installConfig to install-config.yaml so openshift-install can read it
err = ioutil.WriteFile(installConfigPath, installConfig, 0600)
