// NewInitConfiguration returns an InitConfiguration with appropriate defaults
// set for WKS.
NewInitConfiguration returns an InitConfiguration with appropriate defaults
set for WKS.
// NewInitConfiguration returns an InitConfiguration with appropriate defaults // set for WKS .
func NewInitConfiguration(params InitConfigurationParams) *kubeadmapi.InitConfiguration {
	ic := &kubeadmapi.InitConfiguration{
		TypeMeta: metav1.TypeMeta{
			Kind:       constants.InitConfigurationKind,
			APIVersion: kubeadmapi.SchemeGroupVersion.String(),
		},
		LocalAPIEndpoint: kubeadmapi.APIEndpoint{
			AdvertiseAddress: params.KubeletConfig.NodeIP,
		},
		BootstrapTokens: []kubeadmapi.BootstrapToken{
			{
				Token: params.BootstrapToken,
			},
		},
		NodeRegistration: kubeadmapi.NodeRegistrationOptions{
			Name: params.NodeName,
			KubeletExtraArgs: map[string]string{
				"node-ip": params.KubeletConfig.NodeIP,
			},
		},
	}
	if params.KubeletConfig.CloudProvider != "" {
		ic.NodeRegistration.KubeletExtraArgs["cloud-provider"] = params.KubeletConfig.CloudProvider
	}
	return ic
}
func NewInitConfiguration ( params InitConfigurationParams ) * kubeadmapi . InitConfiguration { ic := & kubeadmapi . InitConfiguration { TypeMeta : metav1 . TypeMeta { Kind : constants . InitConfigurationKind , APIVersion : kubeadmapi . SchemeGroupVersion . String ( ) , } , LocalAPIEndpoint : kubeadmapi . APIEndpoint { AdvertiseAddress : params . KubeletConfig . NodeIP , } , BootstrapTokens : [ ] kubeadmapi . BootstrapToken { { Token : params . BootstrapToken , } , } , NodeRegistration : kubeadmapi . NodeRegistrationOptions { Name : params . NodeName , KubeletExtraArgs : map [ string ] string { " " : params . KubeletConfig . NodeIP , } , } , } if params . KubeletConfig . CloudProvider != " " { ic . NodeRegistration . KubeletExtraArgs [ " " ] = params . KubeletConfig . CloudProvider } return ic }
NewInitConfiguration returns an InitConfiguration with appropriate defaults
set for WKS.
NewInitConfiguration returns an InitConfiguration with appropriate defaults set for WKS .