Documentation ¶
Index ¶
- Constants
- Variables
- type ConnectionManager
- func (cm *ConnectionManager) Connect(ctx context.Context, vcenter string) error
- func (cm *ConnectionManager) ConnectByInstance(ctx context.Context, vsphereInstance *VSphereInstance) error
- func (cm *ConnectionManager) Logout()
- func (cm *ConnectionManager) Verify() error
- func (cm *ConnectionManager) VerifyWithContext(ctx context.Context) error
- func (cm *ConnectionManager) WhichVCandDCByFCDId(ctx context.Context, fcdID string) (*FcdDiscoveryInfo, error)
- func (cm *ConnectionManager) WhichVCandDCByNodeId(ctx context.Context, nodeID string, searchBy FindVM) (*VmDiscoveryInfo, error)
- func (cm *ConnectionManager) WhichVCandDCByZone(ctx context.Context, zone string) (*DiscoveryInfo, error)
- type DiscoveryInfo
- type FcdDiscoveryInfo
- type FindVM
- type VSphereInstance
- type VmDiscoveryInfo
Constants ¶
Variables ¶
var ( ErrConnectionNotFound = errors.New(ConnectionNotFoundErrMsg) ErrUnsupportedConfiguration = errors.New(UnsupportedConfigurationErrMsg) )
Error constants
Functions ¶
This section is empty.
Types ¶
type ConnectionManager ¶
type ConnectionManager struct { // Maps the VC server to VSphereInstance VsphereInstanceMap map[string]*VSphereInstance // contains filtered or unexported fields }
ConnectionManager encapsulates vCenter connections
func NewConnectionManager ¶
func NewConnectionManager(config *vcfg.Config, secretLister v1.SecretLister) *ConnectionManager
func (*ConnectionManager) Connect ¶
func (cm *ConnectionManager) Connect(ctx context.Context, vcenter string) error
func (*ConnectionManager) ConnectByInstance ¶
func (cm *ConnectionManager) ConnectByInstance(ctx context.Context, vsphereInstance *VSphereInstance) error
ConnectByInstance connects to vCenter with existing credentials If credentials are invalid:
- It will fetch credentials from credentialManager
- Update the credentials
- Connects again to vCenter with fetched credentials
func (*ConnectionManager) Logout ¶
func (cm *ConnectionManager) Logout()
func (*ConnectionManager) Verify ¶
func (cm *ConnectionManager) Verify() error
func (*ConnectionManager) VerifyWithContext ¶
func (cm *ConnectionManager) VerifyWithContext(ctx context.Context) error
func (*ConnectionManager) WhichVCandDCByFCDId ¶
func (cm *ConnectionManager) WhichVCandDCByFCDId(ctx context.Context, fcdID string) (*FcdDiscoveryInfo, error)
func (*ConnectionManager) WhichVCandDCByNodeId ¶
func (cm *ConnectionManager) WhichVCandDCByNodeId(ctx context.Context, nodeID string, searchBy FindVM) (*VmDiscoveryInfo, error)
func (*ConnectionManager) WhichVCandDCByZone ¶
func (cm *ConnectionManager) WhichVCandDCByZone(ctx context.Context, zone string) (*DiscoveryInfo, error)
WhichVCandDCByZone gets the corresponding VC+DC combo that supports the availability zone TODO: we currently only support a single VC/DC combinations until we support availability zones *** Working Idea *** The current thinking is that Datacenters will be tagged with a "zone" value. This function will be passed the zone from the k8s cluster then "look up" the tag on datacenter using a method similar to what is done in the function WhichVCandDCByNodeId (aka in parallel) then return the DiscoveryInfo for that zone. This should handle non-unique DatastoreCluster and Datastore names between Datacenters. *** Working Idea ***
type DiscoveryInfo ¶
type DiscoveryInfo struct { DataCenter *vclib.Datacenter VcServer string }
DiscoveryInfo contains VC+DC info based on a given zone
type FcdDiscoveryInfo ¶
type FcdDiscoveryInfo struct { DataCenter *vclib.Datacenter FCDInfo *vclib.FirstClassDiskInfo VcServer string }
FcdDiscoveryInfo contains FCD info about a discovered FCD
type VSphereInstance ¶
type VSphereInstance struct { Conn *vclib.VSphereConnection Cfg *vcfg.VirtualCenterConfig }
VSphereInstance represents a vSphere instance where one or more kubernetes nodes are running.
type VmDiscoveryInfo ¶
type VmDiscoveryInfo struct { DataCenter *vclib.Datacenter VM *vclib.VirtualMachine VcServer string UUID string NodeName string }
VmDiscoveryInfo contains VM info about a discovered VM