// BuildGKE builds a new GKE cloud provider, manager etc.
BuildGKE builds a new GKE cloud provider, manager etc.
// BuildGKE builds a new GKE cloud provider manager etc .
func BuildGKE(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider {
	if do.DiscoverySpecified() {
		glog.Fatal("GKE gets nodegroup specification via API, command line specs are not allowed")
	}
	var config io.ReadCloser
	if opts.CloudConfig != "" {
		var err error
		config, err = os.Open(opts.CloudConfig)
		if err != nil {
			glog.Fatalf("Couldn't open cloud provider configuration %s: %#v", opts.CloudConfig, err)
		}
		defer config.Close()
	}
	mode := ModeGKE
	if opts.NodeAutoprovisioningEnabled {
		mode = ModeGKENAP
	}
	manager, err := CreateGkeManager(config, mode, opts.ClusterName, opts.Regional)
	if err != nil {
		glog.Fatalf("Failed to create GKE Manager: %v", err)
	}
	provider, err := BuildGkeCloudProvider(manager, rl)
	if err != nil {
		glog.Fatalf("Failed to create GKE cloud provider: %v", err)
	}
	return provider
}
func BuildGKE ( opts config . AutoscalingOptions , do cloudprovider . NodeGroupDiscoveryOptions , rl * cloudprovider . ResourceLimiter ) cloudprovider . CloudProvider { if do . DiscoverySpecified ( ) { glog . Fatal ( " " ) } var config io . ReadCloser if opts . CloudConfig != " " { var err error config , err = os . Open ( opts . CloudConfig ) if err != nil { glog . Fatalf ( " " , opts . CloudConfig , err ) } defer config . Close ( ) } mode := ModeGKE if opts . NodeAutoprovisioningEnabled { mode = ModeGKENAP } manager , err := CreateGkeManager ( config , mode , opts . ClusterName , opts . Regional ) if err != nil { glog . Fatalf ( " " , err ) } provider , err := BuildGkeCloudProvider ( manager , rl ) if err != nil { glog . Fatalf ( " " , err ) } return provider }
BuildGKE builds a new GKE cloud provider, manager etc.
BuildGKE builds a new GKE cloud provider manager etc .