Skip to content
Permalink
Browse files

remove ServiceAccount in cloud config, previously used to set the cli…

…ent user agent

Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
  • Loading branch information
andrewsykim committed Oct 8, 2019
1 parent 2c39733 commit bf936d198074593341ffe6f6b672d928037dd20a
@@ -35,6 +35,8 @@ const (
// ProviderName is the name of the cloud provider registered with
// Kubernetes.
ProviderName string = "vsphere"
// ClientName is the user agent passed into the controller client builder.
ClientName string = "vsphere-cloud-controller-manager"
)

func init() {
@@ -62,7 +64,7 @@ func newVSphere(cfg *vcfg.Config, finalize ...bool) (*VSphere, error) {

// Initialize initializes the cloud provider.
func (vs *VSphere) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{}) {
client, err := clientBuilder.Client(vs.cfg.Global.ServiceAccount)
client, err := clientBuilder.Client(ClientName)
if err == nil {
klog.V(1).Info("Kubernetes Client Init Succeeded")

@@ -88,9 +88,6 @@ func (cfg *Config) FromEnv() error {
if v := os.Getenv("VSPHERE_SECRET_NAMESPACE"); v != "" {
cfg.Global.SecretNamespace = v
}
if v := os.Getenv("VSPHERE_SERVICE_ACCOUNT"); v != "" {
cfg.Global.ServiceAccount = v
}

if v := os.Getenv("VSPHERE_ROUNDTRIP_COUNT"); v != "" {
tmp, err := strconv.ParseUint(v, 10, 32)
@@ -318,9 +315,6 @@ func (cfg *Config) validateConfig() error {
if cfg.Global.RoundTripperCount == 0 {
cfg.Global.RoundTripperCount = DefaultRoundTripperCount
}
if cfg.Global.ServiceAccount == "" {
cfg.Global.ServiceAccount = DefaultK8sServiceAccount
}
if cfg.Global.VCenterPort == "" {
cfg.Global.VCenterPort = DefaultVCenterPort
}
@@ -29,10 +29,6 @@ const (
// exposing the API service.
DefaultAPIBinding string = ":43001"

// DefaultK8sServiceAccount is the default name of the Kubernetes
// service account.
DefaultK8sServiceAccount string = "cloud-controller-manager"

// DefaultVCenterPort is the default port used to access vCenter.
DefaultVCenterPort string = "443"

@@ -43,9 +43,6 @@ type Config struct {
SecretName string `gcfg:"secret-name"`
// Secret Namespace where secret will be present that has vCenter credentials.
SecretNamespace string `gcfg:"secret-namespace"`
// The kubernetes service account used to launch the cloud controller manager.
// Default: cloud-controller-manager
ServiceAccount string `gcfg:"service-account"`
// Secret directory in the event that:
// 1) we don't want to use the k8s API to listen for changes to secrets
// 2) we are not in a k8s env, namely DC/OS, since CSI is CO agnostic

0 comments on commit bf936d1

Please sign in to comment.
You can’t perform that action at this time.