-
Notifications
You must be signed in to change notification settings - Fork 34
/
feature_membership_schema.go
executable file
·444 lines (442 loc) · 17.2 KB
/
feature_membership_schema.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
// Copyright 2023 Google LLC. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package beta
import (
"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
)
func DCLFeatureMembershipSchema() *dcl.Schema {
return &dcl.Schema{
Info: &dcl.Info{
Title: "GkeHub/FeatureMembership",
Description: "The GkeHub FeatureMembership resource",
StructName: "FeatureMembership",
Mutex: "{{project}}/{{location}}/{{feature}}",
},
Paths: &dcl.Paths{
Get: &dcl.Path{
Description: "The function used to get information about a FeatureMembership",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "featureMembership",
Required: true,
Description: "A full instance of a FeatureMembership",
},
},
},
Apply: &dcl.Path{
Description: "The function used to apply information about a FeatureMembership",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "featureMembership",
Required: true,
Description: "A full instance of a FeatureMembership",
},
},
},
Delete: &dcl.Path{
Description: "The function used to delete a FeatureMembership",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "featureMembership",
Required: true,
Description: "A full instance of a FeatureMembership",
},
},
},
DeleteAll: &dcl.Path{
Description: "The function used to delete all FeatureMembership",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "project",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
dcl.PathParameters{
Name: "location",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
dcl.PathParameters{
Name: "feature",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
},
},
List: &dcl.Path{
Description: "The function used to list information about many FeatureMembership",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "project",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
dcl.PathParameters{
Name: "location",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
dcl.PathParameters{
Name: "feature",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
},
},
},
Components: &dcl.Components{
Schemas: map[string]*dcl.Component{
"FeatureMembership": &dcl.Component{
Title: "FeatureMembership",
ID: "projects/{{project}}/locations/{{location}}/features/{{feature}}/memberships/{{membership}}",
ParentContainer: "project",
HasCreate: true,
SchemaProperty: dcl.Property{
Type: "object",
Required: []string{
"project",
"location",
"feature",
"membership",
},
Properties: map[string]*dcl.Property{
"configmanagement": &dcl.Property{
Type: "object",
GoName: "Configmanagement",
GoType: "FeatureMembershipConfigmanagement",
Description: "Config Management-specific spec.",
Properties: map[string]*dcl.Property{
"binauthz": &dcl.Property{
Type: "object",
GoName: "Binauthz",
GoType: "FeatureMembershipConfigmanagementBinauthz",
Description: "Binauthz configuration for the cluster.",
Properties: map[string]*dcl.Property{
"enabled": &dcl.Property{
Type: "boolean",
GoName: "Enabled",
Description: "Whether binauthz is enabled in this cluster.",
},
},
},
"configSync": &dcl.Property{
Type: "object",
GoName: "ConfigSync",
GoType: "FeatureMembershipConfigmanagementConfigSync",
Description: "Config Sync configuration for the cluster.",
SendEmpty: true,
Properties: map[string]*dcl.Property{
"git": &dcl.Property{
Type: "object",
GoName: "Git",
GoType: "FeatureMembershipConfigmanagementConfigSyncGit",
Properties: map[string]*dcl.Property{
"gcpServiceAccountEmail": &dcl.Property{
Type: "string",
GoName: "GcpServiceAccountEmail",
Description: "The GCP Service Account Email used for auth when secretType is gcpServiceAccount.",
ResourceReferences: []*dcl.PropertyResourceReference{
&dcl.PropertyResourceReference{
Resource: "Iam/ServiceAccount",
Field: "email",
},
},
},
"httpsProxy": &dcl.Property{
Type: "string",
GoName: "HttpsProxy",
Description: "URL for the HTTPS proxy to be used when communicating with the Git repo.",
},
"policyDir": &dcl.Property{
Type: "string",
GoName: "PolicyDir",
Description: "The path within the Git repository that represents the top level of the repo to sync. Default: the root directory of the repository.",
},
"secretType": &dcl.Property{
Type: "string",
GoName: "SecretType",
Description: "Type of secret configured for access to the Git repo. Must be one of ssh, cookiefile, gcenode, token, gcpserviceaccount or none. The validation of this is case-sensitive.",
},
"syncBranch": &dcl.Property{
Type: "string",
GoName: "SyncBranch",
Description: "The branch of the repository to sync from. Default: master.",
},
"syncRepo": &dcl.Property{
Type: "string",
GoName: "SyncRepo",
Description: "The URL of the Git repository to use as the source of truth.",
},
"syncRev": &dcl.Property{
Type: "string",
GoName: "SyncRev",
Description: "Git revision (tag or hash) to check out. Default HEAD.",
},
"syncWaitSecs": &dcl.Property{
Type: "string",
GoName: "SyncWaitSecs",
Description: "Period in seconds between consecutive syncs. Default: 15.",
},
},
},
"oci": &dcl.Property{
Type: "object",
GoName: "Oci",
GoType: "FeatureMembershipConfigmanagementConfigSyncOci",
Properties: map[string]*dcl.Property{
"gcpServiceAccountEmail": &dcl.Property{
Type: "string",
GoName: "GcpServiceAccountEmail",
Description: "The GCP Service Account Email used for auth when secret_type is gcpserviceaccount. ",
ResourceReferences: []*dcl.PropertyResourceReference{
&dcl.PropertyResourceReference{
Resource: "Iam/ServiceAccount",
Field: "email",
},
},
},
"policyDir": &dcl.Property{
Type: "string",
GoName: "PolicyDir",
Description: "The absolute path of the directory that contains the local resources. Default: the root directory of the image.",
},
"secretType": &dcl.Property{
Type: "string",
GoName: "SecretType",
Description: "Type of secret configured for access to the OCI Image. Must be one of gcenode, gcpserviceaccount or none. The validation of this is case-sensitive.",
},
"syncRepo": &dcl.Property{
Type: "string",
GoName: "SyncRepo",
Description: "The OCI image repository URL for the package to sync from. e.g. LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME.",
},
"syncWaitSecs": &dcl.Property{
Type: "string",
GoName: "SyncWaitSecs",
Description: "Period in seconds(int64 format) between consecutive syncs. Default: 15.",
},
},
},
"preventDrift": &dcl.Property{
Type: "boolean",
GoName: "PreventDrift",
Description: "Set to true to enable the Config Sync admission webhook to prevent drifts. If set to `false`, disables the Config Sync admission webhook and does not prevent drifts.",
ServerDefault: true,
},
"sourceFormat": &dcl.Property{
Type: "string",
GoName: "SourceFormat",
Description: "Specifies whether the Config Sync Repo is in \"hierarchical\" or \"unstructured\" mode.",
},
},
},
"hierarchyController": &dcl.Property{
Type: "object",
GoName: "HierarchyController",
GoType: "FeatureMembershipConfigmanagementHierarchyController",
Description: "Hierarchy Controller configuration for the cluster.",
Properties: map[string]*dcl.Property{
"enableHierarchicalResourceQuota": &dcl.Property{
Type: "boolean",
GoName: "EnableHierarchicalResourceQuota",
Description: "Whether hierarchical resource quota is enabled in this cluster.",
},
"enablePodTreeLabels": &dcl.Property{
Type: "boolean",
GoName: "EnablePodTreeLabels",
Description: "Whether pod tree labels are enabled in this cluster.",
},
"enabled": &dcl.Property{
Type: "boolean",
GoName: "Enabled",
Description: "Whether Hierarchy Controller is enabled in this cluster.",
},
},
},
"policyController": &dcl.Property{
Type: "object",
GoName: "PolicyController",
GoType: "FeatureMembershipConfigmanagementPolicyController",
Description: "Policy Controller configuration for the cluster.",
Properties: map[string]*dcl.Property{
"auditIntervalSeconds": &dcl.Property{
Type: "string",
GoName: "AuditIntervalSeconds",
Description: "Sets the interval for Policy Controller Audit Scans (in seconds). When set to 0, this disables audit functionality altogether.",
},
"enabled": &dcl.Property{
Type: "boolean",
GoName: "Enabled",
Description: "Enables the installation of Policy Controller. If false, the rest of PolicyController fields take no effect.",
},
"exemptableNamespaces": &dcl.Property{
Type: "array",
GoName: "ExemptableNamespaces",
Description: "The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.",
SendEmpty: true,
ListType: "list",
Items: &dcl.Property{
Type: "string",
GoType: "string",
},
},
"logDeniesEnabled": &dcl.Property{
Type: "boolean",
GoName: "LogDeniesEnabled",
Description: "Logs all denies and dry run failures.",
},
"monitoring": &dcl.Property{
Type: "object",
GoName: "Monitoring",
GoType: "FeatureMembershipConfigmanagementPolicyControllerMonitoring",
Description: "Specifies the backends Policy Controller should export metrics to. For example, to specify metrics should be exported to Cloud Monitoring and Prometheus, specify backends: [\"cloudmonitoring\", \"prometheus\"]. Default: [\"cloudmonitoring\", \"prometheus\"]",
ServerDefault: true,
Properties: map[string]*dcl.Property{
"backends": &dcl.Property{
Type: "array",
GoName: "Backends",
Description: " Specifies the list of backends Policy Controller will export to. Specifying an empty value `[]` disables metrics export.",
ServerDefault: true,
SendEmpty: true,
ListType: "list",
Items: &dcl.Property{
Type: "string",
GoType: "FeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnum",
Enum: []string{
"MONITORING_BACKEND_UNSPECIFIED",
"PROMETHEUS",
"CLOUD_MONITORING",
},
},
},
},
},
"mutationEnabled": &dcl.Property{
Type: "boolean",
GoName: "MutationEnabled",
Description: "Enable or disable mutation in policy controller. If true, mutation CRDs, webhook and controller deployment will be deployed to the cluster.",
},
"referentialRulesEnabled": &dcl.Property{
Type: "boolean",
GoName: "ReferentialRulesEnabled",
Description: "Enables the ability to use Constraint Templates that reference to objects other than the object currently being evaluated.",
},
"templateLibraryInstalled": &dcl.Property{
Type: "boolean",
GoName: "TemplateLibraryInstalled",
Description: "Installs the default template library along with Policy Controller.",
},
},
},
"version": &dcl.Property{
Type: "string",
GoName: "Version",
Description: "Optional. Version of ACM to install. Defaults to the latest version.",
ServerDefault: true,
},
},
},
"feature": &dcl.Property{
Type: "string",
GoName: "Feature",
Description: "The name of the feature",
Immutable: true,
ResourceReferences: []*dcl.PropertyResourceReference{
&dcl.PropertyResourceReference{
Resource: "Gkehub/Feature",
Field: "name",
Parent: true,
},
},
},
"location": &dcl.Property{
Type: "string",
GoName: "Location",
Description: "The location of the feature",
Immutable: true,
},
"membership": &dcl.Property{
Type: "string",
GoName: "Membership",
Description: "The name of the membership",
Immutable: true,
ResourceReferences: []*dcl.PropertyResourceReference{
&dcl.PropertyResourceReference{
Resource: "Gkehub/Membership",
Field: "name",
},
},
},
"mesh": &dcl.Property{
Type: "object",
GoName: "Mesh",
GoType: "FeatureMembershipMesh",
Description: "Manage Mesh Features",
Properties: map[string]*dcl.Property{
"controlPlane": &dcl.Property{
Type: "string",
GoName: "ControlPlane",
GoType: "FeatureMembershipMeshControlPlaneEnum",
Description: "**DEPRECATED** Whether to automatically manage Service Mesh control planes. Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, AUTOMATIC, MANUAL",
Enum: []string{
"CONTROL_PLANE_MANAGEMENT_UNSPECIFIED",
"AUTOMATIC",
"MANUAL",
},
},
"management": &dcl.Property{
Type: "string",
GoName: "Management",
GoType: "FeatureMembershipMeshManagementEnum",
Description: "Whether to automatically manage Service Mesh. Possible values: MANAGEMENT_UNSPECIFIED, MANAGEMENT_AUTOMATIC, MANAGEMENT_MANUAL",
Enum: []string{
"MANAGEMENT_UNSPECIFIED",
"MANAGEMENT_AUTOMATIC",
"MANAGEMENT_MANUAL",
},
},
},
},
"project": &dcl.Property{
Type: "string",
GoName: "Project",
Description: "The project of the feature",
Immutable: true,
ResourceReferences: []*dcl.PropertyResourceReference{
&dcl.PropertyResourceReference{
Resource: "Cloudresourcemanager/Project",
Field: "name",
Parent: true,
},
},
},
},
},
},
},
},
}
}