forked from logicmonitor/k8s-collectorset-controller
/
types.go
55 lines (47 loc) · 1.86 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
package v1alpha1
import (
"github.com/logicmonitor/k8s-collectorset-controller/pkg/distributor"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// CollectorSetState is the CollectorSet controller's state string.
type CollectorSetState string
const (
// CollectorSetStateCreated is a status string.
CollectorSetStateCreated CollectorSetState = "Created"
// CollectorSetStateRegistered is a status string.
CollectorSetStateRegistered CollectorSetState = "Registered"
// CollectorSetResourcePlural is the plural for the CRD.
CollectorSetResourcePlural = "collectorsets"
)
// CollectorSet represents the collectorset in Kubernetes.
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type CollectorSet struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec CollectorSetSpec `json:"spec"`
Status CollectorSetStatus `json:"status,omitempty"`
}
// CollectorSetSpec represents the collectorset controller's spec.
type CollectorSetSpec struct {
Replicas *int32 `json:"replicas"`
Size string `json:"size,omitempty"`
Policy *CollectorSetPolicy `json:"policy"`
}
// CollectorSetStatus is the CollectorSet controller's status.
type CollectorSetStatus struct {
State CollectorSetState `json:"state,omitempty"`
IDs []int32 `json:"ids,omitempty"`
}
// CollectorSetPolicy is the CollectorSet controller's status.
type CollectorSetPolicy struct {
Orchestrator string `json:"orchestrator,omitempty"`
DistibutionStrategy *distributor.Type `json:"distributionStrategy"`
}
// CollectorSetList represents a list of collectorsets.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type CollectorSetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []CollectorSet `json:"items"`
}