-
Notifications
You must be signed in to change notification settings - Fork 188
/
types.go
61 lines (50 loc) · 1.75 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
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"net"
)
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Cluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterSpec `json:"spec"`
}
type ClusterSpec struct {
ClusterID string `json:"cluster_id"` // perhaps this could just be a hash of the name...?
ColorCodes []string `json:"color_codes"`
ServiceCIDR []string `json:"service_cidr"`
ClusterCIDR []string `json:"cluster_cidr"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Cluster `json:"items"`
}
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Endpoint struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec EndpointSpec `json:"spec"`
}
type EndpointSpec struct {
ClusterID string `json:"cluster_id"`
CableName string `json:"cable_name"`
Hostname string `json:"hostname"`
Subnets []string `json:"subnets"`
PrivateIP net.IP `json:"private_ip"`
PublicIP net.IP `json:"public_ip"`
NATEnabled bool `json:"nat_enabled"`
Backend string `json:"backend"`
BackendConfig map[string]string `json:"backend_config,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type EndpointList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Endpoint `json:"items"`
}