This repository has been archived by the owner on Jun 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
75 lines (62 loc) · 2.1 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package linode
import (
"github.com/linode/linodego"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
api "pharmer.dev/pharmer/apis/v1alpha1"
)
const (
LinodeProviderGroupName = "linodeproviderconfig"
LinodeProviderKind = "LinodeClusterProviderConfig"
LinodeProviderAPIVersion = "v1alpha1"
)
type LinodeMachineProviderSpec struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Roles []api.MachineRole `json:"roles,omitempty"`
Region string `json:"region,omitempty"`
Type string `json:"type,omitempty"`
Image string `json:"image,omitempty"`
Pubkey string `json:"pubkey,omitempty"`
}
type LinodeMachineProviderStatus struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
InstanceID int `json:"instanceID"`
InstanceStatus string `json:"instanceStatus"`
}
type LinodeClusterProviderStatus struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Network Network `json:"network,omitempty"`
}
type LinodeClusterProviderSpec struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
}
// Network encapsulates AWS networking resources.
type Network struct {
APIServerLB *LinodeNodeBalancer `json:"apiServerLb,omitempty"`
}
// NodeBalancer represents a NodeBalancer object
type LinodeNodeBalancer struct {
ID int `json:"id"`
Label *string `json:"label"`
Region string `json:"region"`
Hostname *string `json:"hostname"`
IPv4 *string `json:"ipv4"`
IPv6 *string `json:"ipv6"`
ClientConnThrottle int `json:"client_conn_throttle"`
Tags []string `json:"tags"`
}
func DescribeLoadBalancer(lb *linodego.NodeBalancer) *LinodeNodeBalancer {
return &LinodeNodeBalancer{
ID: lb.ID,
Label: lb.Label,
Region: lb.Region,
Hostname: lb.Hostname,
IPv4: lb.IPv4,
IPv6: lb.IPv6,
ClientConnThrottle: lb.ClientConnThrottle,
Tags: lb.Tags,
}
}