topology

package
v1.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAvailabilityZoneName is the name of the default availability
	// zone used in backwards compatibility mode.
	DefaultAvailabilityZoneName = "default"

	// KubernetesTopologyZoneLabelKey is the label used to specify the
	// availability zone for a VM.
	KubernetesTopologyZoneLabelKey = "topology.kubernetes.io/zone"

	// NamespaceRPAnnotationKey is the annotation value set by WCP that
	// indicates the managed object ID of the resource pool for a given
	// namespace.
	NamespaceRPAnnotationKey = "vmware-system-resource-pool"

	// NamespaceFolderAnnotationKey is the annotation value set by WCP
	// that indicates the managed object ID of the folder for a given
	// namespace.
	NamespaceFolderAnnotationKey = "vmware-system-vm-folder"
)

Variables

View Source
var (
	// ErrNoAvailabilityZones occurs when no availability zones are detected.
	ErrNoAvailabilityZones = errors.New("no availability zones")

	// ErrWcpFaultDomainsFSSIsEnabled occurs when a function is invoked that
	// is disabled when the WCP_FaultDomains FSS is enabled.
	ErrWcpFaultDomainsFSSIsEnabled = errors.New("wcp fault domains fss is enabled")
)

Functions

func GetAvailabilityZone

func GetAvailabilityZone(
	ctx context.Context,
	client ctrlclient.Client,
	availabilityZoneName string) (topologyv1.AvailabilityZone, error)

GetAvailabilityZone returns a named AvailabilityZone resource.

func GetAvailabilityZones

func GetAvailabilityZones(
	ctx context.Context,
	client ctrlclient.Client) ([]topologyv1.AvailabilityZone, error)

GetAvailabilityZones returns a list of the AvailabilityZone resources.

func GetDefaultAvailabilityZone

func GetDefaultAvailabilityZone(
	ctx context.Context,
	client ctrlclient.Client) (topologyv1.AvailabilityZone, error)

GetDefaultAvailabilityZone returns the default AvailabilityZone resource by inspecting the available, DevOps Namespace resources and transforming them into AvailabilityZone resources by virtue of the annotations on the Namespace that indicate the managed object IDs of the Namespace's vSphere Resource Pool and Folder objects.

func GetNamespaceFolderAndRPMoID

func GetNamespaceFolderAndRPMoID(
	ctx context.Context,
	client ctrlclient.Client,
	availabilityZoneName, namespace string) (string, string, error)

GetNamespaceFolderAndRPMoID returns the Folder and ResourcePool MoID for the zone and namespace.

func GetNamespaceFolderAndRPMoIDs

func GetNamespaceFolderAndRPMoIDs(
	ctx context.Context,
	client ctrlclient.Client,
	namespace string) (string, []string, error)

GetNamespaceFolderAndRPMoIDs returns the Folder and ResourcePool MoIDs for the namespace, across all zones.

func GetNamespaceFolderMoID

func GetNamespaceFolderMoID(
	ctx context.Context,
	client ctrlclient.Client,
	namespace string) (string, error)

GetNamespaceFolderMoID returns the FolderMoID for the namespace.

func LookupZoneForClusterMoID

func LookupZoneForClusterMoID(
	ctx context.Context,
	client ctrlclient.Client,
	clusterMoID string) (string, error)

LookupZoneForClusterMoID returns the zone for the given Cluster MoID.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL