/
datasource_types.go
53 lines (43 loc) · 1.6 KB
/
datasource_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
package v1
import (
osko "github.com/oskoperator/osko/api/osko/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ConnectionDetails specify how to connect to your metrics data provider
// +kubebuilder:validation:MinProperties=1
// +kubebuilder:validation:MaxProperties=1
type ConnectionDetails struct {
Mimir *osko.Mimir `json:"mimir,omitempty"`
Cortex *osko.Cortex `json:"cortex,omitempty"`
}
// DatasourceSpec defines the desired state of Datasource
type DatasourceSpec struct {
Description Description `json:"description,omitempty"`
Type string `json:"type,omitempty"`
ConnectionDetails osko.ConnectionDetails `json:"connectionDetails,omitempty"`
}
// DatasourceStatus defines the observed state of Datasource
type DatasourceStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Namespaced
// Datasource is the Schema for the datasources API
type Datasource struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec DatasourceSpec `json:"spec,omitempty"`
Status DatasourceStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// DatasourceList contains a list of Datasource
type DatasourceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Datasource `json:"items"`
}
func init() {
SchemeBuilder.Register(&Datasource{}, &DatasourceList{})
}