Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultK8sServiceAccount is the default name of the Kubernetes // service account for csi controller. DefaultK8sServiceAccount string = "vsphere-csi-controller" // DefaultVCenterPort is the default port used to access vCenter. DefaultVCenterPort string = "443" // DefaultCloudConfigPath is the default path of csi config file DefaultCloudConfigPath = "/etc/cloud/csi-vsphere.conf" // EnvCloudConfig contains the path to the CSI vSphere Config EnvCloudConfig = "VSPHERE_CSI_CONFIG" )
Variables ¶
View Source
var ( // ErrUsernameMissing is returned when the provided username is empty. ErrUsernameMissing = errors.New("Username is missing") // ErrPasswordMissing is returned when the provided password is empty. ErrPasswordMissing = errors.New("Password is missing") // ErrInvalidVCenterIP is returned when the provided vCenter IP address is // missing from the provided configuration. ErrInvalidVCenterIP = errors.New("vsphere.conf does not have the VirtualCenter IP address specified") // ErrMissingVCenter is returned when the provided configuration does not // define any vCenters. ErrMissingVCenter = errors.New("No Virtual Center hosts defined") )
Errors
Functions ¶
Types ¶
type Config ¶
type Config struct { Global struct { //vCenter IP address or FQDN VCenterIP string // Kubernetes Cluster ID ClusterID string `gcfg:"cluster-id"` // vCenter username. User string `gcfg:"user"` // vCenter password in clear text. Password string `gcfg:"password"` // vCenter port. VCenterPort string `gcfg:"port"` // True if vCenter uses self-signed cert. InsecureFlag bool `gcfg:"insecure-flag"` // Datacenter in which Node VMs are located. Datacenters string `gcfg:"datacenters"` } // Virtual Center configurations VirtualCenter map[string]*VirtualCenterConfig // Tag categories and tags which correspond to "built-in node labels: zones and region" Labels struct { Zone string `gcfg:"zone"` Region string `gcfg:"region"` } }
Config is used to read and store information from the cloud configuration file
func FromEnvOrSim ¶
func FromEnvOrSim() (*Config, func())
FromEnvOrSim return a vsphere config from either environment variables or simulates them
func GetCnsconfig ¶
GetCnsconfig returns Config from specified config file path
type VirtualCenterConfig ¶
type VirtualCenterConfig struct { // vCenter username. User string `gcfg:"user"` // vCenter password in clear text. Password string `gcfg:"password"` // vCenter port. VCenterPort string `gcfg:"port"` // True if vCenter uses self-signed cert. InsecureFlag bool `gcfg:"insecure-flag"` // Datacenter in which VMs are located. Datacenters string `gcfg:"datacenters"` }
VirtualCenterConfig contains information used to access a remote vCenter endpoint.
Click to show internal directories.
Click to hide internal directories.