Documentation
¶
Overview ¶
Package vsphere provides a cluster-destroyer for vsphere clusters
Package vsphere provides a cluster-destroyer for vsphere clusters.
Index ¶
- func New(logger logrus.FieldLogger, metadata *installertypes.ClusterMetadata) (providers.Destroyer, error)
- type API
- type Client
- func (c *Client) DeleteCnsVolumes(ctx context.Context, volume cnstypes.CnsVolume) error
- func (c *Client) DeleteFolder(ctx context.Context, f mo.Folder) error
- func (c *Client) DeleteHostZoneObjects(ctx context.Context, infraID string) error
- func (c *Client) DeleteStoragePolicy(ctx context.Context, policyName string) error
- func (c *Client) DeleteTag(ctx context.Context, id string) error
- func (c *Client) DeleteTagCategory(ctx context.Context, categoryName string) error
- func (c *Client) DeleteVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error
- func (c *Client) GetCnsVolumes(ctx context.Context, infraID string) ([]cnstypes.CnsVolume, error)
- func (c *Client) GetVCenterName() string
- func (c *Client) ListFolders(ctx context.Context, tagID string) ([]mo.Folder, error)
- func (c *Client) ListVirtualMachines(ctx context.Context, tagID string) ([]mo.VirtualMachine, error)
- func (c *Client) Logout()
- func (c *Client) StopVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error
- type ClusterUninstaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(logger logrus.FieldLogger, metadata *installertypes.ClusterMetadata) (providers.Destroyer, error)
New returns an VSphere destroyer from ClusterMetadata.
Types ¶
type API ¶
type API interface {
Logout()
ListFolders(ctx context.Context, tagID string) ([]mo.Folder, error)
ListVirtualMachines(ctx context.Context, tagID string) ([]mo.VirtualMachine, error)
StopVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error
DeleteFolder(ctx context.Context, f mo.Folder) error
DeleteVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error
DeleteStoragePolicy(ctx context.Context, policyName string) error
DeleteTag(ctx context.Context, id string) error
DeleteTagCategory(ctx context.Context, id string) error
DeleteHostZoneObjects(ctx context.Context, infraID string) error
DeleteCnsVolumes(ctx context.Context, volume cnstypes.CnsVolume) error
GetCnsVolumes(ctx context.Context, infraID string) ([]cnstypes.CnsVolume, error)
GetVCenterName() string
}
API represents the calls made to the API.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client makes calls to the Azure API.
func NewClient ¶
func NewClient(vCenter, username, password string, logger logrus.FieldLogger) (*Client, error)
NewClient initializes a client. Logout() must be called when you are done with the client.
func (*Client) DeleteCnsVolumes ¶
DeleteCnsVolumes deletes the CNS volume.
func (*Client) DeleteFolder ¶
DeleteFolder deletes a Folder.
func (*Client) DeleteHostZoneObjects ¶
DeleteHostZoneObjects removes from the vCenter cluster the associated OCP cluster's vm-host group (VirtualMachine) and the vm-host affinity rule.
func (*Client) DeleteStoragePolicy ¶
DeleteStoragePolicy deletes a Storage Policy named `policyName`.
func (*Client) DeleteTagCategory ¶
DeleteTagCategory deletes a Tag Category named `categoryName`.
func (*Client) DeleteVirtualMachine ¶
DeleteVirtualMachine deletes a VirtualMachine.
func (*Client) GetCnsVolumes ¶
GetCnsVolumes returns the list of CNS volumes associated with the cluster that is being destroyed.
func (*Client) GetVCenterName ¶
GetVCenterName returns the name of the vcenter being queried.
func (*Client) ListFolders ¶
ListFolders returns all ManagedObjects of type "Folder".
func (*Client) ListVirtualMachines ¶
func (c *Client) ListVirtualMachines(ctx context.Context, tagID string) ([]mo.VirtualMachine, error)
ListVirtualMachines returns ManagedObjects of type "VirtualMachine".
func (*Client) StopVirtualMachine ¶
StopVirtualMachine stops a VM if it's not already powered off.
type ClusterUninstaller ¶
type ClusterUninstaller struct {
ClusterID string
InfraID string
Logger logrus.FieldLogger
// contains filtered or unexported fields
}
ClusterUninstaller holds the various options for the cluster we want to delete.
func (*ClusterUninstaller) Run ¶
func (o *ClusterUninstaller) Run() (*installertypes.ClusterQuota, error)
Run is the entrypoint to start the uninstall process.