Documentation
¶
Index ¶
- Constants
- func CompressAndEncodeString(str string) (string, error)
- func GetClientCacheTTL(clientConfig *corev1.ConfigMap) time.Duration
- func NetworkExists(net infrav1.Network) bool
- func UnmarshalAllSecretConfigs(in []byte, out *[]SecretConfig) error
- type Account
- type AffinityGroup
- type AffinityGroupIface
- type Client
- func NewClientFromBytesConfig(conf []byte, clientConfig *corev1.ConfigMap) (Client, error)
- func NewClientFromCSAPIClient(cs *cloudstack.CloudStackClient) Client
- func NewClientFromConf(conf Config, clientConfig *corev1.ConfigMap) (Client, error)
- func NewClientFromK8sSecret(endpointSecret *corev1.Secret, clientConfig *corev1.ConfigMap) (Client, error)
- func NewClientFromYamlPath(confPath string, secretName string) (Client, error)
- type Config
- type Domain
- type IsoNetworkIface
- type NetworkIface
- type ResourceType
- type SecretConfig
- type TagIface
- type User
- type UserCredIFace
- type VMIface
- type ZoneIFace
Constants ¶
View Source
const ( AntiAffinityGroupType = "host anti-affinity" AffinityGroupType = "host affinity" )
View Source
const ( NetOffering = "DefaultIsolatedNetworkOfferingWithSourceNatService" K8sDefaultAPIPort = 6443 NetworkTypeIsolated = "Isolated" NetworkProtocolTCP = "tcp" )
View Source
const ( ClusterTagNamePrefix = "CAPC_cluster_" CreatedByCAPCTagName = "created_by_CAPC" ResourceTypeNetwork ResourceType = "Network" ResourceTypeIPAddress ResourceType = "PublicIpAddress" )
View Source
const ClientCacheTTLKey = "client-cache-ttl"
View Source
const ClientConfigMapName = "capc-client-config"
View Source
const ClientConfigMapNamespace = "capc-system"
View Source
const DefaultClientCacheTTL = time.Duration(1 * time.Hour)
Variables ¶
This section is empty.
Functions ¶
func CompressAndEncodeString ¶
func GetClientCacheTTL ¶
GetClientCacheTTL returns a client cache TTL duration from the passed config map
func NetworkExists ¶
NetworkExists checks that the network already exists based on the presence of all fields. Assumes that the a fetch has been done on network statuses prior.
func UnmarshalAllSecretConfigs ¶
func UnmarshalAllSecretConfigs(in []byte, out *[]SecretConfig) error
UnmarshalAllSecretConfigs parses a yaml document for each secret.
Types ¶
type AffinityGroup ¶
type AffinityGroupIface ¶
type AffinityGroupIface interface {
FetchAffinityGroup(*AffinityGroup) error
GetOrCreateAffinityGroup(*AffinityGroup) error
DeleteAffinityGroup(*AffinityGroup) error
AssociateAffinityGroup(*infrav1.CloudStackMachine, AffinityGroup) error
DisassociateAffinityGroup(*infrav1.CloudStackMachine, AffinityGroup) error
}
type Client ¶
type Client interface {
VMIface
NetworkIface
AffinityGroupIface
TagIface
ZoneIFace
IsoNetworkIface
UserCredIFace
NewClientInDomainAndAccount(string, string) (Client, error)
}
func NewClientFromBytesConfig ¶
NewClientFromBytesConfig returns a client from a bytes array that unmarshals to a yaml config.
func NewClientFromCSAPIClient ¶
func NewClientFromCSAPIClient(cs *cloudstack.CloudStackClient) Client
NewClientFromCSAPIClient creates a client from a CloudStack-Go API client. Mostly used for testing.
func NewClientFromConf ¶
NewClientFromConf creates a new Cloud Client form a map of strings to strings.
type Config ¶
type Config struct {
APIUrl string `yaml:"api-url"`
APIKey string `yaml:"api-key"`
SecretKey string `yaml:"secret-key"`
VerifySSL string `yaml:"verify-ssl"`
}
cloud-config ini structure.
type IsoNetworkIface ¶
type IsoNetworkIface interface {
GetOrCreateIsolatedNetwork(*infrav1.CloudStackFailureDomain, *infrav1.CloudStackIsolatedNetwork, *infrav1.CloudStackCluster) error
AssociatePublicIPAddress(*infrav1.CloudStackFailureDomain, *infrav1.CloudStackIsolatedNetwork, *infrav1.CloudStackCluster) error
GetOrCreateLoadBalancerRule(*infrav1.CloudStackFailureDomain, *infrav1.CloudStackIsolatedNetwork, *infrav1.CloudStackCluster) error
OpenFirewallRules(*infrav1.CloudStackIsolatedNetwork) error
GetPublicIP(*infrav1.CloudStackFailureDomain, *infrav1.CloudStackIsolatedNetwork, *infrav1.CloudStackCluster) (*cloudstack.PublicIpAddress, error)
ResolveLoadBalancerRuleDetails(*infrav1.CloudStackFailureDomain, *infrav1.CloudStackIsolatedNetwork, *infrav1.CloudStackCluster) error
AssignVMToLoadBalancerRule(isoNet *infrav1.CloudStackIsolatedNetwork, instanceID string) error
DeleteNetwork(infrav1.Network) error
DisposeIsoNetResources(*infrav1.CloudStackFailureDomain, *infrav1.CloudStackIsolatedNetwork, *infrav1.CloudStackCluster) error
}
type NetworkIface ¶
type ResourceType ¶
type ResourceType string
type SecretConfig ¶
type TagIface ¶
type TagIface interface {
AddClusterTag(ResourceType, string, *infrav1.CloudStackCluster) error
DeleteClusterTag(ResourceType, string, *infrav1.CloudStackCluster) error
AddCreatedByCAPCTag(ResourceType, string) error
DeleteCreatedByCAPCTag(ResourceType, string) error
DoClusterTagsAllowDisposal(ResourceType, string) (bool, error)
AddTags(ResourceType, string, map[string]string) error
GetTags(ResourceType, string) (map[string]string, error)
DeleteTags(ResourceType, string, map[string]string) error
}
type UserCredIFace ¶
type VMIface ¶
type VMIface interface {
GetOrCreateVMInstance(*infrav1.CloudStackMachine, *clusterv1.Machine, *infrav1.CloudStackCluster, *infrav1.CloudStackFailureDomain, *infrav1.CloudStackAffinityGroup, string) error
ResolveVMInstanceDetails(*infrav1.CloudStackMachine) error
DestroyVMInstance(*infrav1.CloudStackMachine) error
}
type ZoneIFace ¶
type ZoneIFace interface {
ResolveZone(*infrav1.CloudStackZoneSpec) error
ResolveNetworkForZone(*infrav1.CloudStackZoneSpec) error
}
Click to show internal directories.
Click to hide internal directories.