Documentation
¶
Overview ¶
Package clouds provides utility functions for interacting with clouds.
Package clouds provides utility functions for interacting with clouds.
Index ¶
- Variables
- func GetMaasResourcePools(c *components.MaasPluginConfig) ([]string, error)
- func GetMaasZones(c *components.MaasPluginConfig) ([]string, error)
- func GetMockMaasClient(_, _ string) (*maasclient.Client, error)
- func ReadAwsProfile(c *components.AWSPluginConfig) (bool, error)
- func ReadAwsSTSProfile(c *components.AWSPluginConfig) error
- func ReadMaasClientProps(c *components.MaasPluginConfig) error
- func ReadVsphereAccountProps(account *vsphere.CloudAccount) error
- func ValidateAwsCreds(c *components.AWSPluginConfig) error
- func ValidateCloudAccountVsphere(account *vsphere.CloudAccount) error
- type MockMaasAccount
- type MockMaasResourcePools
- type MockMaasZones
Constants ¶
This section is empty.
Variables ¶
var (
// GetMaasClient is defined to enable monkeypatching during testing
GetMaasClient = getMaasClient
)
var GetVSphereDriver = getVSphereDriver
GetVSphereDriver enables monkey-patching the vSphere driver for integration tests
Functions ¶
func GetMaasResourcePools ¶ added in v0.1.2
func GetMaasResourcePools(c *components.MaasPluginConfig) ([]string, error)
GetMaasResourcePools fetches a list of resource pools in the cluster
func GetMaasZones ¶ added in v0.1.2
func GetMaasZones(c *components.MaasPluginConfig) ([]string, error)
GetMaasZones fetches a list of availability zones in the cluster
func GetMockMaasClient ¶ added in v0.1.2
func GetMockMaasClient(_, _ string) (*maasclient.Client, error)
GetMockMaasClient returns a mock MAAS client for testing
func ReadAwsProfile ¶ added in v0.1.2
func ReadAwsProfile(c *components.AWSPluginConfig) (bool, error)
ReadAwsProfile reads the AWS credentials profile from the local .aws directory.
func ReadAwsSTSProfile ¶ added in v0.1.2
func ReadAwsSTSProfile(c *components.AWSPluginConfig) error
ReadAwsSTSProfile reads the AWS STS config from the local .aws directory.
func ReadMaasClientProps ¶ added in v0.1.2
func ReadMaasClientProps(c *components.MaasPluginConfig) error
ReadMaasClientProps gathers and validates MAAS client credentials
func ReadVsphereAccountProps ¶
func ReadVsphereAccountProps(account *vsphere.CloudAccount) error
ReadVsphereAccountProps prompts the user to configure vSphere account properties
func ValidateAwsCreds ¶ added in v0.1.2
func ValidateAwsCreds(c *components.AWSPluginConfig) error
ValidateAwsCreds validates the AWS credentials and returns an error if they are not valid.
func ValidateCloudAccountVsphere ¶
func ValidateCloudAccountVsphere(account *vsphere.CloudAccount) error
ValidateCloudAccountVsphere validates that the provided vSphere cloud account is valid
Types ¶
type MockMaasAccount ¶ added in v0.1.2
type MockMaasAccount struct {
maasclient.Account
}
MockMaasAccount replaces the maasclient.Account struct for integration testing
func (*MockMaasAccount) ListAuthorisationTokens ¶ added in v0.1.2
func (a *MockMaasAccount) ListAuthorisationTokens() ([]entity.AuthorisationTokenListItem, error)
ListAuthorisationTokens replaces the maasclient.Account.ListAuthorisationTokens method for integration testing
type MockMaasResourcePools ¶ added in v0.1.2
type MockMaasResourcePools struct {
maasclient.ResourcePools
// contains filtered or unexported fields
}
MockMaasResourcePools replaces the maasclient.ResourcePools struct for integration testing
func (*MockMaasResourcePools) Get ¶ added in v0.1.2
func (r *MockMaasResourcePools) Get() ([]entity.ResourcePool, error)
Get replaces the maasclient.ResourcePools.Get method for integration testing
type MockMaasZones ¶ added in v0.1.2
type MockMaasZones struct {
maasclient.Zones
// contains filtered or unexported fields
}
MockMaasZones replaces the maasclient.Zones struct for integration testing