aboutsummaryrefslogtreecommitdiffstats
path: root/src/monitor/pkg/apis/k8splugin/v1alpha1/types.go
blob: 064591fcd85cbd813af916812e4dba82080efeab (plain)
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
package v1alpha1

import (
	appsv1 "k8s.io/api/apps/v1"
	v1 "k8s.io/api/batch/v1"
	corev1 "k8s.io/api/core/v1"
	v1beta1 "k8s.io/api/extensions/v1beta1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ResourceBundleState is the Schema for the ResourceBundleStatees API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +genclient
type ResourceBundleState struct {
	metav1.TypeMeta   `json:",inline" yaml:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata" yaml:"metadata"`

	Spec   ResourceBundleStateSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
	Status ResourceBundleStatus    `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

// ResourceBundleStateSpec defines the desired state of ResourceBundleState
// +k8s:openapi-gen=true
type ResourceBundleStateSpec struct {
	Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,1,opt,name=selector"`
}

// ResourceBundleStatus defines the observed state of ResourceBundleState
// +k8s:openapi-gen=true
type ResourceBundleStatus struct {
	Ready               bool                 `json:"ready" protobuf:"varint,1,opt,name=ready"`
	ResourceCount       int32                `json:"resourceCount" protobuf:"varint,2,opt,name=resourceCount"`
	PodStatuses         []PodStatus          `json:"podStatuses" protobuf:"varint,3,opt,name=podStatuses"`
	ServiceStatuses     []corev1.Service     `json:"serviceStatuses" protobuf:"varint,4,opt,name=serviceStatuses"`
	ConfigMapStatuses   []corev1.ConfigMap   `json:"configMapStatuses" protobuf:"varint,5,opt,name=configMapStatuses"`
	DeploymentStatuses  []appsv1.Deployment  `json:"deploymentStatuses" protobuf:"varint,6,opt,name=deploymentStatuses"`
	SecretStatuses      []corev1.Secret      `json:"secretStatuses" protobuf:"varint,7,opt,name=secretStatuses"`
	DaemonSetStatuses   []appsv1.DaemonSet   `json:"daemonSetStatuses" protobuf:"varint,8,opt,name=daemonSetStatuses"`
	IngressStatuses     []v1beta1.Ingress    `json:"ingressStatuses" protobuf:"varint,11,opt,name=ingressStatuses"`
	JobStatuses         []v1.Job             `json:"jobStatuses" protobuf:"varint,12,opt,name=jobStatuses"`
	StatefulSetStatuses []appsv1.StatefulSet `json:"statefulSetStatuses" protobuf:"varint,13,opt,name=statefulSetStatuses"`
}

// PodStatus defines the observed state of ResourceBundleState
// +k8s:openapi-gen=true
type PodStatus struct {
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	Ready             bool             `json:"ready" protobuf:"varint,2,opt,name=ready"`
	Status            corev1.PodStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ResourceBundleStateList contains a list of ResourceBundleState
type ResourceBundleStateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ResourceBundleState `json:"items"`
}

func init() {
	SchemeBuilder.Register(&ResourceBundleState{}, &ResourceBundleStateList{})
}