@@ -75,11 +75,14 @@ type ClusterClass struct {
75
75
metav1.TypeMeta `json:",inline"`
76
76
// metadata is the standard object's metadata.
77
77
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
78
+ // +optional
78
79
metav1.ObjectMeta `json:"metadata,omitempty"`
79
80
80
81
// spec is the desired state of ClusterClass.
82
+ // +optional
81
83
Spec ClusterClassSpec `json:"spec,omitempty"`
82
84
// status is the observed state of ClusterClass.
85
+ // +optional
83
86
Status ClusterClassStatus `json:"status,omitempty"`
84
87
}
85
88
@@ -255,10 +258,12 @@ type MachineDeploymentClass struct {
255
258
// class denotes a type of worker node present in the cluster,
256
259
// this name MUST be unique within a ClusterClass and can be referenced
257
260
// in the Cluster to create a managed MachineDeployment.
261
+ // +required
258
262
Class string `json:"class"`
259
263
260
264
// template is a local struct containing a collection of templates for creation of
261
265
// MachineDeployment objects representing a set of worker nodes.
266
+ // +required
262
267
Template MachineDeploymentClassTemplate `json:"template"`
263
268
264
269
// machineHealthCheck defines a MachineHealthCheck for this MachineDeploymentClass.
@@ -300,6 +305,7 @@ type MachineDeploymentClass struct {
300
305
// Defaults to 0 (machine will be considered available as soon as it
301
306
// is ready)
302
307
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
308
+ // +optional
303
309
MinReadySeconds * int32 `json:"minReadySeconds,omitempty"`
304
310
305
311
// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
@@ -319,6 +325,7 @@ type MachineDeploymentClass struct {
319
325
// strategy is the deployment strategy to use to replace existing machines with
320
326
// new ones.
321
327
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
328
+ // +optional
322
329
Strategy * MachineDeploymentStrategy `json:"strategy,omitempty"`
323
330
}
324
331
@@ -332,10 +339,12 @@ type MachineDeploymentClassTemplate struct {
332
339
333
340
// bootstrap contains the bootstrap template reference to be used
334
341
// for the creation of worker Machines.
342
+ // +required
335
343
Bootstrap LocalObjectTemplate `json:"bootstrap"`
336
344
337
345
// infrastructure contains the infrastructure template reference to be used
338
346
// for the creation of worker Machines.
347
+ // +required
339
348
Infrastructure LocalObjectTemplate `json:"infrastructure"`
340
349
}
341
350
@@ -410,10 +419,12 @@ type MachinePoolClass struct {
410
419
// class denotes a type of machine pool present in the cluster,
411
420
// this name MUST be unique within a ClusterClass and can be referenced
412
421
// in the Cluster to create a managed MachinePool.
422
+ // +required
413
423
Class string `json:"class"`
414
424
415
425
// template is a local struct containing a collection of templates for creation of
416
426
// MachinePools objects representing a pool of worker nodes.
427
+ // +required
417
428
Template MachinePoolClassTemplate `json:"template"`
418
429
419
430
// failureDomains is the list of failure domains the MachinePool should be attached to.
@@ -452,6 +463,7 @@ type MachinePoolClass struct {
452
463
// Defaults to 0 (machine will be considered available as soon as it
453
464
// is ready)
454
465
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.
466
+ // +optional
455
467
MinReadySeconds * int32 `json:"minReadySeconds,omitempty"`
456
468
}
457
469
@@ -465,10 +477,12 @@ type MachinePoolClassTemplate struct {
465
477
466
478
// bootstrap contains the bootstrap template reference to be used
467
479
// for the creation of the Machines in the MachinePool.
480
+ // +required
468
481
Bootstrap LocalObjectTemplate `json:"bootstrap"`
469
482
470
483
// infrastructure contains the infrastructure template reference to be used
471
484
// for the creation of the MachinePool.
485
+ // +required
472
486
Infrastructure LocalObjectTemplate `json:"infrastructure"`
473
487
}
474
488
@@ -495,12 +509,14 @@ func (m MachineHealthCheckClass) IsZero() bool {
495
509
// be configured in the Cluster topology and used in patches.
496
510
type ClusterClassVariable struct {
497
511
// name of the variable.
512
+ // +required
498
513
Name string `json:"name"`
499
514
500
515
// required specifies if the variable is required.
501
516
// Note: this applies to the variable as a whole and thus the
502
517
// top-level object defined in the schema. If nested fields are
503
518
// required, this will be specified inside the schema.
519
+ // +required
504
520
Required bool `json:"required"`
505
521
506
522
// metadata is the metadata of a variable.
@@ -513,6 +529,7 @@ type ClusterClassVariable struct {
513
529
Metadata ClusterClassVariableMetadata `json:"metadata,omitempty"`
514
530
515
531
// schema defines the schema of the variable.
532
+ // +required
516
533
Schema VariableSchema `json:"schema"`
517
534
}
518
535
@@ -539,6 +556,7 @@ type VariableSchema struct {
539
556
// openAPIV3Schema defines the schema of a variable via OpenAPI v3
540
557
// schema. The schema is a subset of the schema used in
541
558
// Kubernetes CRDs.
559
+ // +required
542
560
OpenAPIV3Schema JSONSchemaProps `json:"openAPIV3Schema"`
543
561
}
544
562
@@ -549,9 +567,11 @@ type VariableSchema struct {
549
567
// which are not supported in CAPI have been removed.
550
568
type JSONSchemaProps struct {
551
569
// description is a human-readable description of this variable.
570
+ // +optional
552
571
Description string `json:"description,omitempty"`
553
572
554
573
// example is an example for this variable.
574
+ // +optional
555
575
Example * apiextensionsv1.JSON `json:"example,omitempty"`
556
576
557
577
// type is the type of the variable.
@@ -871,9 +891,11 @@ const (
871
891
// ClusterClassPatch defines a patch which is applied to customize the referenced templates.
872
892
type ClusterClassPatch struct {
873
893
// name of the patch.
894
+ // +required
874
895
Name string `json:"name"`
875
896
876
897
// description is a human-readable description of this patch.
898
+ // +optional
877
899
Description string `json:"description,omitempty"`
878
900
879
901
// enabledIf is a Go template to be used to calculate if a patch should be enabled.
@@ -900,12 +922,14 @@ type ClusterClassPatch struct {
900
922
// PatchDefinition defines a patch which is applied to customize the referenced templates.
901
923
type PatchDefinition struct {
902
924
// selector defines on which templates the patch should be applied.
925
+ // +required
903
926
Selector PatchSelector `json:"selector"`
904
927
905
928
// jsonPatches defines the patches which should be applied on the templates
906
929
// matching the selector.
907
930
// Note: Patches will be applied in the order of the array.
908
931
// +kubebuilder:validation:MaxItems=100
932
+ // +required
909
933
JSONPatches []JSONPatch `json:"jsonPatches"`
910
934
}
911
935
@@ -916,12 +940,15 @@ type PatchDefinition struct {
916
940
// Note: The results of selection based on the individual fields are ANDed.
917
941
type PatchSelector struct {
918
942
// apiVersion filters templates by apiVersion.
943
+ // +required
919
944
APIVersion string `json:"apiVersion"`
920
945
921
946
// kind filters templates by kind.
947
+ // +required
922
948
Kind string `json:"kind"`
923
949
924
950
// matchResources selects templates based on where they are referenced.
951
+ // +required
925
952
MatchResources PatchSelectorMatch `json:"matchResources"`
926
953
}
927
954
@@ -972,13 +999,15 @@ type PatchSelectorMatchMachinePoolClass struct {
972
999
type JSONPatch struct {
973
1000
// op defines the operation of the patch.
974
1001
// Note: Only `add`, `replace` and `remove` are supported.
1002
+ // +required
975
1003
Op string `json:"op"`
976
1004
977
1005
// path defines the path of the patch.
978
1006
// Note: Only the spec of a template can be patched, thus the path has to start with /spec/.
979
1007
// Note: For now the only allowed array modifications are `append` and `prepend`, i.e.:
980
1008
// * for op: `add`: only index 0 (prepend) and - (append) are allowed
981
1009
// * for op: `replace` or `remove`: no indexes are allowed
1010
+ // +required
982
1011
Path string `json:"path"`
983
1012
984
1013
// value defines the value of the patch.
@@ -1039,6 +1068,7 @@ type ExternalPatchDefinition struct {
1039
1068
type LocalObjectTemplate struct {
1040
1069
// ref is a required reference to a custom resource
1041
1070
// offered by a provider.
1071
+ // +required
1042
1072
Ref * corev1.ObjectReference `json:"ref"`
1043
1073
}
1044
1074
@@ -1079,6 +1109,7 @@ type ClusterClassV1Beta2Status struct {
1079
1109
// ClusterClassStatusVariable defines a variable which appears in the status of a ClusterClass.
1080
1110
type ClusterClassStatusVariable struct {
1081
1111
// name is the name of the variable.
1112
+ // +required
1082
1113
Name string `json:"name"`
1083
1114
1084
1115
// definitionsConflict specifies whether or not there are conflicting definitions for a single variable name.
@@ -1087,6 +1118,7 @@ type ClusterClassStatusVariable struct {
1087
1118
1088
1119
// definitions is a list of definitions for a variable.
1089
1120
// +kubebuilder:validation:MaxItems=100
1121
+ // +required
1090
1122
Definitions []ClusterClassStatusVariableDefinition `json:"definitions"`
1091
1123
}
1092
1124
@@ -1095,12 +1127,14 @@ type ClusterClassStatusVariableDefinition struct {
1095
1127
// from specifies the origin of the variable definition.
1096
1128
// This will be `inline` for variables defined in the ClusterClass or the name of a patch defined in the ClusterClass
1097
1129
// for variables discovered from a DiscoverVariables runtime extensions.
1130
+ // +required
1098
1131
From string `json:"from"`
1099
1132
1100
1133
// required specifies if the variable is required.
1101
1134
// Note: this applies to the variable as a whole and thus the
1102
1135
// top-level object defined in the schema. If nested fields are
1103
1136
// required, this will be specified inside the schema.
1137
+ // +required
1104
1138
Required bool `json:"required"`
1105
1139
1106
1140
// metadata is the metadata of a variable.
@@ -1113,6 +1147,7 @@ type ClusterClassStatusVariableDefinition struct {
1113
1147
Metadata ClusterClassVariableMetadata `json:"metadata,omitempty"`
1114
1148
1115
1149
// schema defines the schema of the variable.
1150
+ // +required
1116
1151
Schema VariableSchema `json:"schema"`
1117
1152
}
1118
1153
@@ -1151,6 +1186,7 @@ type ClusterClassList struct {
1151
1186
metav1.TypeMeta `json:",inline"`
1152
1187
// metadata is the standard list's metadata.
1153
1188
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds
1189
+ // +optional
1154
1190
metav1.ListMeta `json:"metadata,omitempty"`
1155
1191
// items is the list of ClusterClasses.
1156
1192
Items []ClusterClass `json:"items"`
0 commit comments