func (cs *CSCloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{}) {
}
Initialize passes a Kubernetes clientBuilder interface to the cloud provider
package cloudstack
import (
	"context"
	"errors"
	"fmt"
	"io"
	"os"
	"github.com/xanzy/go-cloudstack/v2/cloudstack"
	"gopkg.in/gcfg.v1"
	"k8s.io/apimachinery/pkg/types"
	cloudprovider "k8s.io/cloud-provider"
	"k8s.io/klog"
)
const ProviderName = "external-cloudstack"
type CSConfig struct {
	Global struct {
		APIURL      string `gcfg:"api-url"`
		APIKey      string `gcfg:"api-key"`
		SecretKey   string `gcfg:"secret-key"`
		SSLNoVerify bool   `gcfg:"ssl-no-verify"`
		ProjectID   string `gcfg:"project-id"`
		Zone        string `gcfg:"zone"`
	}
}
type CSCloud struct {
	client    *cloudstack.CloudStackClient
	projectID string  
	zone      string
}
func init() {
	cloudprovider.RegisterCloudProvider(ProviderName, func(config io.Reader) (cloudprovider.Interface, error) {
		cfg, err := readConfig(config)
		if err != nil {
			return nil, err
		}
		return newCSCloud(cfg)
	})
}
func readConfig(config io.Reader) (*CSConfig, error) {
	cfg := &CSConfig{}
	if config == nil {
		return cfg, nil
	}
	if err := gcfg.ReadInto(cfg, config); err != nil {
		return nil, fmt.Errorf("could not parse cloud provider config: %v", err)
	}
	return cfg, nil
}
func newCSCloud(cfg *CSConfig) (*CSCloud, error) {
	cs := &CSCloud{
		projectID: cfg.Global.ProjectID,
		zone:      cfg.Global.Zone,
	}
	if cfg.Global.APIURL != "" && cfg.Global.APIKey != "" && cfg.Global.SecretKey != "" {
		cs.client = cloudstack.NewAsyncClient(cfg.Global.APIURL, cfg.Global.APIKey, cfg.Global.SecretKey, !cfg.Global.SSLNoVerify)
	}
	if cs.client == nil {
		return nil, errors.New("no cloud provider config given")
	}
	return cs, nil
}