-
Notifications
You must be signed in to change notification settings - Fork 6
/
types.go
60 lines (48 loc) · 1.62 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
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
intstr "k8s.io/apimachinery/pkg/util/intstr"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// NodeResourceTopology is a specification for a Foo resource
type NodeResourceTopology struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
TopologyPolicies []string `json:"topologyPolicies"`
Zones ZoneList `json:"zones"`
}
// Zone is the spec for a NodeResourceTopology resource
type Zone struct {
Name string `json:"name"`
Type string `json:"type"`
Parent string `json:"parent,omitempty"`
Costs CostList `json:"costs,omitempty"`
Attributes AttributeList `json:"attributes,omitempty"`
Resources ResourceInfoList `json:"resources,omitempty"`
}
type ZoneList []Zone
type ResourceInfo struct {
Name v1.ResourceName
Allocatable intstr.IntOrString `json:"allocatable"`
Capacity intstr.IntOrString `json:"capacity"`
}
type ResourceInfoList []ResourceInfo
type CostInfo struct {
Name string `json:"name"`
Value int `json:"value"`
}
type CostList []CostInfo
type AttributeInfo struct {
Name string `json:"name"`
Value string `json:"value"`
}
type AttributeList []AttributeInfo
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// NodeResourceTopologyList is a list of NodeResourceTopology resources
type NodeResourceTopologyList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []NodeResourceTopology `json:"items"`
}