clients

package
v0.0.0-...-bf45c1f Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CloudsSecretKey = "clouds.yaml"
)

Variables

This section is empty.

Functions

func GetCACertificate

func GetCACertificate(kubeClient kubernetes.Interface) []byte

GetCACertificate gets the CA certificate from the configmap

func GetCloud

func GetCloud(kubeClient kubernetes.Interface, machine *machinev1.Machine) (clientconfig.Cloud, error)

GetCloud fetches cloud credentials from a secret and return a parsed Cloud structure

func GetCloudFromSecret

func GetCloudFromSecret(kubeClient kubernetes.Interface, namespace string, secretName string, cloudName string) (clientconfig.Cloud, error)

func GetProviderClient

func GetProviderClient(cloud clientconfig.Cloud, cert []byte) (*gophercloud.ProviderClient, error)

GetProviderClient returns an authenticated provider client based on values in the cloud structure

func MachineSpecFromProviderSpec

func MachineSpecFromProviderSpec(providerSpec machinev1.ProviderSpec) (*machinev1alpha1.OpenstackProviderSpec, error)

MachineSpecFromProviderSpec unmarshals a provider status into an OpenStack Machine Status type

Types

type InstanceService

type InstanceService struct {
	// contains filtered or unexported fields
}

func NewInstanceService

func NewInstanceService() (*InstanceService, error)

func NewInstanceServiceFromCloud

func NewInstanceServiceFromCloud(cloud clientconfig.Cloud, cert []byte) (*InstanceService, error)

func NewInstanceServiceFromMachine

func NewInstanceServiceFromMachine(kubeClient kubernetes.Interface, machine *machinev1.Machine) (*InstanceService, error)

TODO: Eventually we'll have a NewInstanceServiceFromCluster too

func (*InstanceService) CreateServerGroup

func (is *InstanceService) CreateServerGroup(name string) (*servergroups.ServerGroup, error)

func (*InstanceService) DoesAvailabilityZoneExist

func (is *InstanceService) DoesAvailabilityZoneExist(azName string) error

DoesAvailabilityZoneExist return an error if AZ with the given name doesn't exist, and nil otherwise

func (*InstanceService) DoesFlavorExist

func (is *InstanceService) DoesFlavorExist(flavorName string) error

DoesFlavorExist returns nil if exactly one flavor exists with the given name.

func (*InstanceService) DoesImageExist

func (is *InstanceService) DoesImageExist(imageName string) error

DoesImageExist returns nil if exactly one image exists with the given name.

func (*InstanceService) GetFlavorID

func (is *InstanceService) GetFlavorID(flavorName string) (string, error)

func (*InstanceService) GetFlavorInfo

func (is *InstanceService) GetFlavorInfo(flavorID string) (flavor *flavors.Flavor, err error)

func (*InstanceService) GetServerGroupByID

func (is *InstanceService) GetServerGroupByID(id string) (*servergroups.ServerGroup, error)

func (*InstanceService) GetServerGroupsByName

func (is *InstanceService) GetServerGroupsByName(name string) ([]servergroups.ServerGroup, error)

Jump to

Keyboard shortcuts

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