packet

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MachineUIDTag = "cluster-api-provider-packet:machine-uid"

	AnnotationUID = "cluster.k8s.io/machine-uid"
)

Variables

View Source
var (
	ErrControlPlanEndpointNotFound = errors.New("control plane not found")
	ErrInvalidRequest              = errors.New("invalid request")
)

Functions

func GenerateClusterTag

func GenerateClusterTag(ID string) string

func GenerateMachineTag

func GenerateMachineTag(ID string) string

func ItemsInList

func ItemsInList(list []string, items []string) bool

ItemsInList checks if all items are in the list

Types

type CreateDeviceRequest

type CreateDeviceRequest struct {
	ExtraTags            []string
	MachineScope         *scope.MachineScope
	ControlPlaneEndpoint string
}

type PacketClient

type PacketClient struct {
	*packngo.Client
}

func GetClient

func GetClient() (*PacketClient, error)

func NewClient

func NewClient(packetAPIKey string) *PacketClient

NewClient creates a new Client for the given Packet credentials

func (*PacketClient) CreateIP

func (p *PacketClient) CreateIP(namespace, clusterName, projectID, facility string) (net.IP, error)

CreateIP reserves an IP via Packet API. The request fails straight if no IP are available for the specified project. This prevent the cluster to become ready.

func (*PacketClient) GetDevice

func (p *PacketClient) GetDevice(deviceID string) (*packngo.Device, error)

func (*PacketClient) GetDeviceAddresses

func (p *PacketClient) GetDeviceAddresses(device *packngo.Device) ([]corev1.NodeAddress, error)

func (*PacketClient) GetDeviceByTags

func (p *PacketClient) GetDeviceByTags(project string, tags []string) (*packngo.Device, error)

func (*PacketClient) GetIPByClusterIdentifier

func (p *PacketClient) GetIPByClusterIdentifier(namespace, name, projectID string) (packngo.IPAddressReservation, error)

func (*PacketClient) NewDevice

func (p *PacketClient) NewDevice(req CreateDeviceRequest) (*packngo.Device, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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