/
chart_types.go
100 lines (90 loc) · 3.48 KB
/
chart_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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:resource:categories=common;giantswarm
// +k8s:openapi-gen=true
// ChartConfig used to represent an app deployed as a Helm Release. Deprecated.
type ChartConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec ChartConfigSpec `json:"spec"`
// +kubebuilder:validation:Optional
Status ChartConfigStatus `json:"status"`
}
// +k8s:openapi-gen=true
type ChartConfigSpec struct {
Chart ChartConfigSpecChart `json:"chart"`
VersionBundle ChartConfigSpecVersionBundle `json:"versionBundle"`
}
// +k8s:openapi-gen=true
type ChartConfigSpecChart struct {
// Channel is the name of the Appr channel to reconcile against,
// e.g. 1-0-stable.
Channel string `json:"channel"`
// ConfigMap references a config map containing values that should be
// applied to the chart.
ConfigMap ChartConfigSpecConfigMap `json:"configMap"`
// UserConfigMap references a config map containing custom values.
// These custom values are specified by the user to override default values.
UserConfigMap ChartConfigSpecConfigMap `json:"userConfigMap"`
// Name is the name of the Helm chart to deploy,
// e.g. kubernetes-node-exporter.
Name string `json:"name"`
// Namespace is the namespace where the Helm chart is to be deployed,
// e.g. giantswarm.
Namespace string `json:"namespace"`
// Release is the name of the Helm release when the chart is deployed,
// e.g. node-exporter.
Release string `json:"release"`
// Secret references a secret containing secret values that should be
// applied to the chart.
Secret ChartConfigSpecSecret `json:"secret"`
}
// +k8s:openapi-gen=true
type ChartConfigSpecConfigMap struct {
// Name is the name of the config map containing chart values to apply,
// e.g. node-exporter-chart-values.
Name string `json:"name"`
// Namespace is the namespace of the values config map,
// e.g. kube-system.
Namespace string `json:"namespace"`
// ResourceVersion is the Kubernetes resource version of the configmap.
// Used to detect if the configmap has changed, e.g. 12345.
ResourceVersion string `json:"resourceVersion"`
}
// +k8s:openapi-gen=true
type ChartConfigSpecSecret struct {
// Name is the name of the secret containing chart values to apply,
// e.g. node-exporter-chart-secret.
Name string `json:"name"`
// Namespace is the namespace of the secret,
// e.g. kube-system.
Namespace string `json:"namespace"`
// ResourceVersion is the Kubernetes resource version of the secret.
// Used to detect if the secret has changed, e.g. 12345.
ResourceVersion string `json:"resourceVersion"`
}
// +k8s:openapi-gen=true
type ChartConfigStatus struct {
// ReleaseStatus is the status of the Helm release when the chart is
// installed, e.g. DEPLOYED.
ReleaseStatus string `json:"releaseStatus"`
// Reason is the description of the last status of helm release when the chart is
// not installed successfully, e.g. deploy resource already exists.
Reason string `json:"reason,omitempty"`
}
// +k8s:openapi-gen=true
type ChartConfigSpecVersionBundle struct {
Version string `json:"version"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ChartConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []ChartConfig `json:"items"`
}