Documentation ¶
Index ¶
- Constants
- func CheckIfClusterRdeNeedsUpgrade(srcRdeTypeVersion string, tgtRdeTypeVersion string) bool
- func GetLoadBalancerIpClaimMarker(clusterName string, clusterID string) string
- func GetLoadBalancerPoolNamePrefix(clusterName string, clusterID string) string
- func GetLoadBalancerPoolNameUsingPrefix(lbPoolNamePrefix string, portSuffix string) string
- func GetVirtualServiceNamePrefix(clusterName string, clusterID string) string
- func GetVirtualServiceNameUsingPrefix(virtualServiceNamePrefix string, portSuffix string) string
- type CapvcdRdeManager
- func (capvcdRdeManager *CapvcdRdeManager) AddToErrorSet(ctx context.Context, ...) error
- func (capvcdRdeManager *CapvcdRdeManager) AddToEventSet(ctx context.Context, ...) error
- func (capvcdRdeManager *CapvcdRdeManager) CheckForEmptyRDEAndUpdateCreatedByVersions(ctx context.Context, infraId string) error
- func (capvcdRdeManager *CapvcdRdeManager) ConvertToLatestRDEVersionFormat(ctx context.Context, rdeID string) (*swagger.DefinedEntity, error)
- func (capvcdRdeManager *CapvcdRdeManager) GetCAPVCDEntity(ctx context.Context, rdeID string) (*swagger.DefinedEntity, *rdeType.CAPVCDSpec, *rdeType.Metadata, ...)
- func (capvcdRdeManager *CapvcdRdeManager) GetRDEVersion(ctx context.Context, rdeID string) (*swagger.DefinedEntity, string, error)
- func (capvcdRdeManager *CapvcdRdeManager) IsCapvcdEntityTypeRegistered(version string) bool
- func (capvcdRdeManager *CapvcdRdeManager) IsVCDKECluster(ctx context.Context, rdeID string) bool
- func (capvcdRdeManager *CapvcdRdeManager) PatchRDE(ctx context.Context, ...) (rde *swagger.DefinedEntity, err error)
- func (capvcdRdeManager *CapvcdRdeManager) SetIsManagementClusterInRDE(ctx context.Context, managementClusterRDEId string) error
- type EntityType
Constants ¶
const ( MaxUpdateRetries = 10 StatusComponentNameCAPVCD = "cluster-api-provider-cloud-director" CAPVCDTypeVendor = "vmware" CAPVCDTypeNss = "capvcdCluster" CAPVCDEntityTypePrefix = "urn:vcloud:type:vmware:capvcdCluster" CAPVCDEntityTypeDefaultMajorVersion = "1" CAPVCDClusterKind = "CAPVCDCluster" CAPVCDClusterEntityApiVersion = "capvcd.vmware.com/v1.1" DefaultRollingWindowSize = 20 // VCDCluster Events RdeUpgraded = "RdeUpgraded" LoadBalancerAvailable = "LoadBalancerAvailable" InfraVappAvailable = "InfraVappAvailable" ControlplaneReady = "ControlplaneReady" LoadbalancerDeleted = "LoadbalancerDeleted" VappDeleted = "vAppDeleted" // VCDCluster Errors // Set RdeError for any errors that occurs during Rde update/validation errors RdeError = "RdeError" // Set LoadBalancerPending for loadBalancer components not created fully LoadBalancerPending = "LoadBalancerPending" // Set LoadBalancerError for any errors that occurs during load balance components create/get/delete LoadBalancerError = "LoadBalancerError" // Set VCDClusterVappCreationError for any errors that occurs during cluster creation VCDClusterVappCreationError = "VCDClusterVAppCreationError" // Set VCDClusterVappDeleteError for any errors that occurs during cluster deletion VCDClusterVappDeleteError = "VCDClusterVAppDeleteError" // Set VCDClusterError for metadata errors; newVdcManager errors; newGWManager errors VCDClusterError = "VCDClusterError" // VCDMachine Events InfraVmPoweredOn = "VcdMachineInfraVMPoweredOn" CloudInitScriptGenerated = "VcdMachineBootstrapScriptGenerated" InfraVmBootstrapped = "VcdMachineBootstrapped" InfraVmDeleted = "VcdMachineInfraVmDeleted" NodeHealthCheckFailed = "VcdMachineHealthCheckFailedEvent" NodeUnhealthy = "VcdMachineNodeUnhealthy" // VCDMachine Errors // Set VCDMachineScriptGenerationError for any errors that occurs during the process of generating and setting the script on the VM VCDMachineScriptGenerationError = "VcdMachineScriptGenerationError" // Set VCDMachineCreationError for any errors that occurs during vcdMachine infrastructure creation VCDMachineCreationError = "VcdMachineCreationError" // Set VCDMachineScriptExecutionError for any errors that occurs during the process of executing the script on the VM VCDMachineScriptExecutionError = "VcdMachineScriptExecutionError" // Set VCDMachineDeletionError for any errors that occurs during vcdMachine infrastructure deletion VCDMachineDeletionError = "VcdMachineDeletionError" // Set VCDMachineError for any errors that occurs during metadata validation, getting newVdcManager/newGateWayManager VCDMachineError = "VCDMachineError" // Set CAPVCDObjectPatchError for any errors during patch execution of vcdmachine object and vcdcluster object CAPVCDObjectPatchError = "CAPVCDObjectPatchError" )
Variables ¶
This section is empty.
Functions ¶
func GetLoadBalancerIpClaimMarker ¶ added in v1.3.0
Types ¶
type CapvcdRdeManager ¶
type CapvcdRdeManager struct { Client *vcdsdk.Client RdeManager *vcdsdk.RDEManager }
func NewCapvcdRdeManager ¶
func NewCapvcdRdeManager(client *vcdsdk.Client, clusterID string) *CapvcdRdeManager
func (*CapvcdRdeManager) AddToErrorSet ¶
func (capvcdRdeManager *CapvcdRdeManager) AddToErrorSet(ctx context.Context, errorName, vcdResourceId, vcdResourceName, detailedErrorMsg string) error
func (*CapvcdRdeManager) AddToEventSet ¶
func (*CapvcdRdeManager) CheckForEmptyRDEAndUpdateCreatedByVersions ¶
func (capvcdRdeManager *CapvcdRdeManager) CheckForEmptyRDEAndUpdateCreatedByVersions(ctx context.Context, infraId string) error
CheckForEmptyRDEAndUpdateCreatedByVersions updates createdBy version and also sets the value for capvcdVersion in the RDE
func (*CapvcdRdeManager) ConvertToLatestRDEVersionFormat ¶
func (capvcdRdeManager *CapvcdRdeManager) ConvertToLatestRDEVersionFormat(ctx context.Context, rdeID string) (*swagger.DefinedEntity, error)
ConvertToLatestRDEVersionFormat updates the RDE version. The upgraded RDE will only contain minimal information related to the cluster after upgrade.
CAPVCD will reconcile the RDE eventually with proper data by CAPVCD.
Invokes the right converter to convert the srcRDE into the format of latest RDE version in use
The function attempts upgrade multiple times as defined by MaxUpdateRetries to avoid failures due to incorrect ETag.
func (*CapvcdRdeManager) GetCAPVCDEntity ¶
func (capvcdRdeManager *CapvcdRdeManager) GetCAPVCDEntity(ctx context.Context, rdeID string) (*swagger.DefinedEntity, *rdeType.CAPVCDSpec, *rdeType.Metadata, *rdeType.CAPVCDStatus, error)
GetCAPVCDEntity parses CAPVCDStatus and CAPVCD
func (*CapvcdRdeManager) GetRDEVersion ¶
func (capvcdRdeManager *CapvcdRdeManager) GetRDEVersion(ctx context.Context, rdeID string) (*swagger.DefinedEntity, string, error)
func (*CapvcdRdeManager) IsCapvcdEntityTypeRegistered ¶
func (capvcdRdeManager *CapvcdRdeManager) IsCapvcdEntityTypeRegistered(version string) bool
func (*CapvcdRdeManager) IsVCDKECluster ¶
func (capvcdRdeManager *CapvcdRdeManager) IsVCDKECluster(ctx context.Context, rdeID string) bool
IsVCDKECluster only returns true/false, not return error. all the errors showing inside the function are all checked in the previous code.
func (*CapvcdRdeManager) PatchRDE ¶
func (capvcdRdeManager *CapvcdRdeManager) PatchRDE(ctx context.Context, specPatch, metadataPatch, capvcdStatusPatch map[string]interface{}, rdeID string, externalID string, updateExternalID bool) (rde *swagger.DefinedEntity, err error)
PatchRDE : Update only specific fields in the RDE. Takes in a map with keys, which contain "." delimitted strings, representing the spec, metadata and cavcd status fields to be updated. Example: To patch only the "spec.capiYaml", "metadata.name", "status.capvcd.version" portion of the RDE, specPatch map should be something like this - specPatch["CapiYaml"] = updated-yaml metadataPatch["Name"] = updated-name capvcdStatusPatch["Version"] = updated-version
func (*CapvcdRdeManager) SetIsManagementClusterInRDE ¶
func (capvcdRdeManager *CapvcdRdeManager) SetIsManagementClusterInRDE(ctx context.Context, managementClusterRDEId string) error
SetIsManagementClusterInRDE : sets the isManagementCluster flag in RDE for the management cluster