// NewJoinConfiguration returns an JoinConfiguration with appropriate defaults
// set for WKS.
NewJoinConfiguration returns an JoinConfiguration with appropriate defaults
set for WKS.
// NewJoinConfiguration returns an JoinConfiguration with appropriate defaults // set for WKS .
func NewJoinConfiguration(params JoinConfigurationParams) *kubeadmapi.JoinConfiguration {
	cfg := &kubeadmapi.JoinConfiguration{
		TypeMeta: metav1.TypeMeta{
			Kind:       constants.JoinConfigurationKind,
			APIVersion: kubeadmapi.SchemeGroupVersion.String(),
		},
		NodeRegistration: kubeadmapi.NodeRegistrationOptions{
			KubeletExtraArgs: map[string]string{
				"node-ip": params.NodeIP,
			},
		},
		Discovery: kubeadmapi.Discovery{
			BootstrapToken: &kubeadmapi.BootstrapTokenDiscovery{
				Token:             params.Token,
				APIServerEndpoint: params.APIServerEndpoint,
				CACertHashes: []string{
					params.CACertHash,
				},
			},
		},
	}
	if params.IsMaster {
		cfg.ControlPlane = &kubeadmapi.JoinControlPlane{
			LocalAPIEndpoint: kubeadmapi.APIEndpoint{
				AdvertiseAddress: params.LocalMasterAdvertiseAddress,
				BindPort:         getOrDefaultLocalMasterBindPort(params.LocalMasterBindPort),
			},
		}
	}
	return cfg
}
func NewJoinConfiguration ( params JoinConfigurationParams ) * kubeadmapi . JoinConfiguration { cfg := & kubeadmapi . JoinConfiguration { TypeMeta : metav1 . TypeMeta { Kind : constants . JoinConfigurationKind , APIVersion : kubeadmapi . SchemeGroupVersion . String ( ) , } , NodeRegistration : kubeadmapi . NodeRegistrationOptions { KubeletExtraArgs : map [ string ] string { " " : params . NodeIP , } , } , Discovery : kubeadmapi . Discovery { BootstrapToken : & kubeadmapi . BootstrapTokenDiscovery { Token : params . Token , APIServerEndpoint : params . APIServerEndpoint , CACertHashes : [ ] string { params . CACertHash , } , } , } , } if params . IsMaster { cfg . ControlPlane = & kubeadmapi . JoinControlPlane { LocalAPIEndpoint : kubeadmapi . APIEndpoint { AdvertiseAddress : params . LocalMasterAdvertiseAddress , BindPort : getOrDefaultLocalMasterBindPort ( params . LocalMasterBindPort ) , } , } } return cfg }
NewJoinConfiguration returns an JoinConfiguration with appropriate defaults
set for WKS.
NewJoinConfiguration returns an JoinConfiguration with appropriate defaults set for WKS .