Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateClusterTag(ID string) string
- func GenerateMachineTag(ID string) string
- func ItemsInList(list []string, items []string) bool
- type CreateDeviceRequest
- type PacketClient
- func (p *PacketClient) CreateIP(namespace, clusterName, projectID, facility string) (net.IP, error)
- func (p *PacketClient) GetDevice(deviceID string) (*packngo.Device, error)
- func (p *PacketClient) GetDeviceAddresses(device *packngo.Device) ([]corev1.NodeAddress, error)
- func (p *PacketClient) GetDeviceByTags(project string, tags []string) (*packngo.Device, error)
- func (p *PacketClient) GetIPByClusterIdentifier(namespace, name, projectID string) (packngo.IPAddressReservation, error)
- func (p *PacketClient) NewDevice(req CreateDeviceRequest) (*packngo.Device, error)
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 GenerateMachineTag ¶
func ItemsInList ¶
ItemsInList checks if all items are in the list
Types ¶
type CreateDeviceRequest ¶
type CreateDeviceRequest struct { ExtraTags []string MachineScope *scope.MachineScope ControlPlaneEndpoint string }
type PacketClient ¶
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 (*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)
Click to show internal directories.
Click to hide internal directories.