...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package v1alpha1
17
18 import (
19 "encoding/json"
20
21 corev1 "k8s.io/api/core/v1"
22 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23 )
24
25
26
27
28
29
30 type RemoteCluster struct {
31 metav1.TypeMeta `json:",inline"`
32 metav1.ObjectMeta `json:"metadata,omitempty"`
33
34 Spec RemoteClusterSpec `json:"spec,omitempty"`
35
36
37 Status RemoteClusterStatus `json:"status,omitempty"`
38 }
39
40
41 type RemoteClusterSpec struct {
42 Namespace string `json:"namespace"`
43 Version string `json:"version"`
44
45 KubeConfig RemoteClusterKubeConfig `json:"kubeConfig"`
46
47
48
49
50
51 ConfigOverride json.RawMessage `json:"configOverride,omitempty"`
52 }
53
54
55 type RemoteClusterKubeConfig struct {
56 SecretRef RemoteClusterSecretRef `json:"secretRef"`
57 }
58
59
60 type RemoteClusterSecretRef struct {
61 Namespace string `json:"namespace"`
62 Name string `json:"name"`
63
64 Key string `json:"key"`
65 }
66
67 type RemoteClusterStatus struct {
68 CurrentVersion string `json:"currentVersion"`
69
70
71
72 Conditions []RemoteClusterCondition `json:"conditions,omitempty"`
73 ObservedGeneration int64 `json:"observedGeneration,omitempty"`
74 }
75
76 type RemoteClusterConditionType string
77
78 var (
79 RemoteClusterConditionInstalled RemoteClusterConditionType = "Installed"
80 RemoteClusterConditionReady RemoteClusterConditionType = "Ready"
81 )
82
83 type RemoteClusterCondition struct {
84 Type RemoteClusterConditionType `json:"type"`
85 Status corev1.ConditionStatus `json:"status"`
86
87 Reason string `json:"reason"`
88 }
89
90
91
92 type RemoteClusterList struct {
93 metav1.TypeMeta `json:",inline"`
94 metav1.ListMeta `json:"metadata,omitempty"`
95 Items []RemoteCluster `json:"items"`
96 }
97