-
Notifications
You must be signed in to change notification settings - Fork 18
/
clickhouse_types.go
65 lines (48 loc) · 1.79 KB
/
clickhouse_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
62
63
64
65
// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clickhouseuserconfig "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/service/clickhouse"
)
// ClickhouseSpec defines the desired state of Clickhouse
type ClickhouseSpec struct {
ServiceCommonSpec `json:",inline"`
// OpenSearch specific user configuration options
UserConfig *clickhouseuserconfig.ClickhouseUserConfig `json:"userConfig,omitempty"`
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// Clickhouse is the Schema for the clickhouses API.
// Info "Exposes secret keys": `CLICKHOUSE_HOST`, `CLICKHOUSE_PORT`, `CLICKHOUSE_USER`, `CLICKHOUSE_PASSWORD`
type Clickhouse struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClickhouseSpec `json:"spec,omitempty"`
Status ServiceStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// ClickhouseList contains a list of Clickhouse
type ClickhouseList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Clickhouse `json:"items"`
}
var _ AivenManagedObject = &Clickhouse{}
func (in *Clickhouse) AuthSecretRef() *AuthSecretReference {
return in.Spec.AuthSecretRef
}
func (in *Clickhouse) Conditions() *[]metav1.Condition {
return &in.Status.Conditions
}
func (in *Clickhouse) NoSecret() bool {
return in.Spec.ConnInfoSecretTargetDisabled != nil && *in.Spec.ConnInfoSecretTargetDisabled
}
func (in *Clickhouse) GetRefs() []*ResourceReferenceObject {
return in.Spec.GetRefs(in.GetNamespace())
}
func (in *Clickhouse) GetConnInfoSecretTarget() ConnInfoSecretTarget {
return in.Spec.ConnInfoSecretTarget
}
func init() {
SchemeBuilder.Register(&Clickhouse{}, &ClickhouseList{})
}