clouds

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package clouds provides utility functions for interacting with clouds.

Package clouds provides utility functions for interacting with clouds.

Index

Constants

This section is empty.

Variables

View Source
var (
	// GetMaasClient is defined to enable monkeypatching during testing
	GetMaasClient = getMaasClient
)
View Source
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 *vcenter.Account) 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 vcenter.Account) 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

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

func (*MockMaasZones) Get added in v0.1.2

func (z *MockMaasZones) Get() ([]entity.Zone, error)

Get replaces the maasclient.Zones.Get method for integration testing

Jump to

Keyboard shortcuts

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