-
Notifications
You must be signed in to change notification settings - Fork 24
/
memberoperatorconfig_types.go
237 lines (191 loc) · 7.48 KB
/
memberoperatorconfig_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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// MemberOperatorConfigSpec contains all configuration parameters of the member operator
// +k8s:openapi-gen=true
type MemberOperatorConfigSpec struct {
// Keeps parameters concerned with authentication
// +optional
Auth AuthConfig `json:"auth,omitempty"`
// Keeps parameters concerned with the autoscaler
// +optional
Autoscaler AutoscalerConfig `json:"autoscaler,omitempty"`
// Keeps parameters concerned with Che/CRW
// +optional
Che CheConfig `json:"che,omitempty"`
// Keeps parameters concerned with the console
// +optional
Console ConsoleConfig `json:"console,omitempty"`
// Environment specifies the member-operator environment such as prod, stage, unit-tests, e2e-tests, dev, etc
// +optional
Environment *string `json:"environment,omitempty"`
// Defines the flag that determines whether User and Identity resources should be created for a UserAccount
// +optional
SkipUserCreation *bool `json:"skipUserCreation,omitempty"`
// Keeps parameters concerned with member status
// +optional
MemberStatus MemberStatusConfig `json:"memberStatus,omitempty"`
// Keeps parameters concerned with the toolchaincluster
// +optional
ToolchainCluster ToolchainClusterConfig `json:"toolchainCluster,omitempty"`
// Keeps parameters concerned with the webhook
// +optional
Webhook WebhookConfig `json:"webhook,omitempty"`
// WebConsolePlugin is used to configure the Web Console Plugin parameters
// +optional
WebConsolePlugin WebConsolePlugin `json:"webConsolePlugin,omitempty"`
}
// Defines all parameters concerned with the autoscaler
// +k8s:openapi-gen=true
type AuthConfig struct {
// Represents the configured identity provider
// +optional
Idp *string `json:"idp,omitempty"`
}
// Defines all parameters concerned with the autoscaler
// +k8s:openapi-gen=true
type AutoscalerConfig struct {
// Defines the flag that determines whether to deploy the autoscaler buffer
// +optional
Deploy *bool `json:"deploy,omitempty"`
// Represents how much memory should be required by the autoscaler buffer
// +optional
BufferMemory *string `json:"bufferMemory,omitempty"`
// Represents the number of autoscaler buffer replicas to request
// +optional
BufferReplicas *int `json:"bufferReplicas,omitempty"`
}
// Defines all parameters concerned with Che
// +k8s:openapi-gen=true
type CheConfig struct {
// Defines the Che/CRW Keycloak route name
// +optional
KeycloakRouteName *string `json:"keycloakRouteName,omitempty"`
// Defines the Che/CRW route name
// +optional
RouteName *string `json:"routeName,omitempty"`
// Defines the Che/CRW operator namespace
// +optional
Namespace *string `json:"namespace,omitempty"`
// Defines a flag that indicates whether the Che/CRW operator is required to be installed on the cluster. May be used in monitoring.
// +optional
Required *bool `json:"required,omitempty"`
// Defines a flag to turn the Che user deletion logic on/off
// +optional
UserDeletionEnabled *bool `json:"userDeletionEnabled,omitempty"`
// Defines all secrets related to Che configuration
// +optional
Secret CheSecret `json:"secret,omitempty"`
}
// Defines all secrets related to Che configuration
// +k8s:openapi-gen=true
type CheSecret struct {
// The reference to the secret that is expected to contain the keys below
// +optional
ToolchainSecret `json:",inline"`
// The key for the Che admin username in the secret values map
// +optional
CheAdminUsernameKey *string `json:"cheAdminUsernameKey,omitempty"`
// The key for the Che admin password in the secret values map
// +optional
CheAdminPasswordKey *string `json:"cheAdminPasswordKey,omitempty"`
}
// Defines all parameters concerned with the console
// +k8s:openapi-gen=true
type ConsoleConfig struct {
// Defines the console route namespace
// +optional
Namespace *string `json:"namespace,omitempty"`
// Defines the console route name
// +optional
RouteName *string `json:"routeName,omitempty"`
}
// GitHubSecret defines all secrets related to GitHub authentication/integration
// +k8s:openapi-gen=true
type GitHubSecret struct {
// The reference to the secret that is expected to contain the keys below
// +optional
ToolchainSecret `json:",inline"`
// The key for the GitHub Access token in the secret values map
// +optional
AccessTokenKey *string `json:"accessTokenKey,omitempty"`
}
// Defines all parameters concerned with the toolchaincluster resource
// +k8s:openapi-gen=true
type ToolchainClusterConfig struct {
// Defines the period in between health checks
// +optional
HealthCheckPeriod *string `json:"healthCheckPeriod,omitempty"`
// Defines the timeout for each health check
// +optional
HealthCheckTimeout *string `json:"healthCheckTimeout,omitempty"`
}
// Defines all parameters concerned with the Webhook
// +k8s:openapi-gen=true
type WebhookConfig struct {
// Defines the flag that determines whether to deploy the Webhook
// +optional
Deploy *bool `json:"deploy,omitempty"`
// Defines all secrets related to webhook configuration
// +optional
Secret *WebhookSecret `json:"secret,omitempty"`
}
// WebhookSecret defines all secrets related to webhook configuration
// +k8s:openapi-gen=true
type WebhookSecret struct {
// The reference to the secret that is expected to contain the keys below
// +optional
ToolchainSecret `json:",inline"`
// The key in the secret values map that contains a comma-separated list of SSH keys
// +optional
VirtualMachineAccessKey *string `json:"virtualMachineAccessKey,omitempty"`
}
// WebConsolePlugin defines the configuration parameters relating to the Web Console Plugin
type WebConsolePlugin struct {
// Deploy determines whether the plugin will be deployed or not
Deploy *bool `json:"deploy,omitempty"`
// PendoKey is the key value used to interact with the Pendo API
// +optional
PendoKey *string `json:"pendoKey,omitempty"`
// PendoHost allows a host URL to be configured instead of communicating directly with the Pendo domain
// +optional
PendoHost *string `json:"pendoHost,omitempty"`
}
// Defines all parameters concerned with member status
// +k8s:openapi-gen=true
type MemberStatusConfig struct {
// Defines the period between refreshes of the member status
// +optional
RefreshPeriod *string `json:"refreshPeriod,omitempty"`
// Defines all secrets related to GitHub authentication/integration
// +optional
GitHubSecret GitHubSecret `json:"gitHubSecret,omitempty"`
}
// MemberOperatorConfigStatus defines the observed state of MemberOperatorConfig
// +k8s:openapi-gen=true
type MemberOperatorConfigStatus struct {
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// MemberOperatorConfig keeps all configuration parameters needed in member operator
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=memberoperatorconfigs,scope=Namespaced
// +kubebuilder:validation:XPreserveUnknownFields
// +operator-sdk:gen-csv:customresourcedefinitions.displayName="Member Operator Config"
type MemberOperatorConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec MemberOperatorConfigSpec `json:"spec,omitempty"`
Status MemberOperatorConfigStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// MemberOperatorConfigList contains a list of MemberOperatorConfig
type MemberOperatorConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []MemberOperatorConfig `json:"items"`
}
func init() {
SchemeBuilder.Register(&MemberOperatorConfig{}, &MemberOperatorConfigList{})
}