// NewClusterConfiguration returns an ClusterConfiguration with appropriate
// defaults set for WKS.
NewClusterConfiguration returns an ClusterConfiguration with appropriate
defaults set for WKS.
// NewClusterConfiguration returns an ClusterConfiguration with appropriate // defaults set for WKS .
func NewClusterConfiguration(params ClusterConfigurationParams) *kubeadmapi.ClusterConfiguration {
	SANs := []string{}
	SANs = append(SANs, params.NodeIPs...)
	SANs = append(SANs, params.ExternalLoadBalancer)
	SANs = append(SANs, params.AdditionalSANs...)
	cc := &kubeadmapi.ClusterConfiguration{
		TypeMeta: metav1.TypeMeta{
			Kind:       constants.ClusterConfigurationKind,
			APIVersion: kubeadmapi.SchemeGroupVersion.String(),
		},
		APIServer: kubeadmapi.APIServer{
			CertSANs:              certSANs(SANs...),
			ControlPlaneComponent: kubeadmapi.ControlPlaneComponent{ExtraArgs: params.ExtraArgs},
		},
		KubernetesVersion:    params.KubernetesVersion,
		ControlPlaneEndpoint: getOrDefaultControlPlaneEndpoint(params.ControlPlaneEndpoint),
		ImageRepository:      params.ImageRepository,
	}
	if params.CloudProvider != "" {
		cpc := kubeadmapi.ControlPlaneComponent{
			ExtraArgs: map[string]string{
				"cloud-provider": params.CloudProvider,
			},
		}
		cc.APIServer.ControlPlaneComponent = cpc
		cc.ControllerManager = cpc
	}
	return cc
}
func NewClusterConfiguration ( params ClusterConfigurationParams ) * kubeadmapi . ClusterConfiguration { SANs := [ ] string { } SANs = append ( SANs , params . NodeIPs ... ) SANs = append ( SANs , params . ExternalLoadBalancer ) SANs = append ( SANs , params . AdditionalSANs ... ) cc := & kubeadmapi . ClusterConfiguration { TypeMeta : metav1 . TypeMeta { Kind : constants . ClusterConfigurationKind , APIVersion : kubeadmapi . SchemeGroupVersion . String ( ) , } , APIServer : kubeadmapi . APIServer { CertSANs : certSANs ( SANs ... ) , ControlPlaneComponent : kubeadmapi . ControlPlaneComponent { ExtraArgs : params . ExtraArgs } , } , KubernetesVersion : params . KubernetesVersion , ControlPlaneEndpoint : getOrDefaultControlPlaneEndpoint ( params . ControlPlaneEndpoint ) , ImageRepository : params . ImageRepository , } if params . CloudProvider != " " { cpc := kubeadmapi . ControlPlaneComponent { ExtraArgs : map [ string ] string { " " : params . CloudProvider , } , } cc . APIServer . ControlPlaneComponent = cpc cc . ControllerManager = cpc } return cc }
NewClusterConfiguration returns an ClusterConfiguration with appropriate
defaults set for WKS.
NewClusterConfiguration returns an ClusterConfiguration with appropriate defaults set for WKS .