@@ -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
@@ -251,10 +254,12 @@ type MachineDeploymentClass struct {
251
254
// class denotes a type of worker node present in the cluster,
252
255
// this name MUST be unique within a ClusterClass and can be referenced
253
256
// in the Cluster to create a managed MachineDeployment.
257
+ // +required
254
258
Class string `json:"class"`
255
259
256
260
// template is a local struct containing a collection of templates for creation of
257
261
// MachineDeployment objects representing a set of worker nodes.
262
+ // +required
258
263
Template MachineDeploymentClassTemplate `json:"template"`
259
264
260
265
// machineHealthCheck defines a MachineHealthCheck for this MachineDeploymentClass.
@@ -296,6 +301,7 @@ type MachineDeploymentClass struct {
296
301
// Defaults to 0 (machine will be considered available as soon as it
297
302
// is ready)
298
303
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
304
+ // +optional
299
305
MinReadySeconds * int32 `json:"minReadySeconds,omitempty"`
300
306
301
307
// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
@@ -315,6 +321,7 @@ type MachineDeploymentClass struct {
315
321
// strategy is the deployment strategy to use to replace existing machines with
316
322
// new ones.
317
323
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
324
+ // +optional
318
325
Strategy * MachineDeploymentStrategy `json:"strategy,omitempty"`
319
326
}
320
327
@@ -328,10 +335,12 @@ type MachineDeploymentClassTemplate struct {
328
335
329
336
// bootstrap contains the bootstrap template reference to be used
330
337
// for the creation of worker Machines.
338
+ // +required
331
339
Bootstrap LocalObjectTemplate `json:"bootstrap"`
332
340
333
341
// infrastructure contains the infrastructure template reference to be used
334
342
// for the creation of worker Machines.
343
+ // +required
335
344
Infrastructure LocalObjectTemplate `json:"infrastructure"`
336
345
}
337
346
@@ -405,10 +414,12 @@ type MachinePoolClass struct {
405
414
// class denotes a type of machine pool present in the cluster,
406
415
// this name MUST be unique within a ClusterClass and can be referenced
407
416
// in the Cluster to create a managed MachinePool.
417
+ // +required
408
418
Class string `json:"class"`
409
419
410
420
// template is a local struct containing a collection of templates for creation of
411
421
// MachinePools objects representing a pool of worker nodes.
422
+ // +required
412
423
Template MachinePoolClassTemplate `json:"template"`
413
424
414
425
// failureDomains is the list of failure domains the MachinePool should be attached to.
@@ -446,6 +457,7 @@ type MachinePoolClass struct {
446
457
// Defaults to 0 (machine will be considered available as soon as it
447
458
// is ready)
448
459
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.
460
+ // +optional
449
461
MinReadySeconds * int32 `json:"minReadySeconds,omitempty"`
450
462
}
451
463
@@ -459,10 +471,12 @@ type MachinePoolClassTemplate struct {
459
471
460
472
// bootstrap contains the bootstrap template reference to be used
461
473
// for the creation of the Machines in the MachinePool.
474
+ // +required
462
475
Bootstrap LocalObjectTemplate `json:"bootstrap"`
463
476
464
477
// infrastructure contains the infrastructure template reference to be used
465
478
// for the creation of the MachinePool.
479
+ // +required
466
480
Infrastructure LocalObjectTemplate `json:"infrastructure"`
467
481
}
468
482
@@ -489,12 +503,14 @@ func (m MachineHealthCheckClass) IsZero() bool {
489
503
// be configured in the Cluster topology and used in patches.
490
504
type ClusterClassVariable struct {
491
505
// name of the variable.
506
+ // +required
492
507
Name string `json:"name"`
493
508
494
509
// required specifies if the variable is required.
495
510
// Note: this applies to the variable as a whole and thus the
496
511
// top-level object defined in the schema. If nested fields are
497
512
// required, this will be specified inside the schema.
513
+ // +required
498
514
Required bool `json:"required"`
499
515
500
516
// metadata is the metadata of a variable.
@@ -507,6 +523,7 @@ type ClusterClassVariable struct {
507
523
Metadata ClusterClassVariableMetadata `json:"metadata,omitempty"`
508
524
509
525
// schema defines the schema of the variable.
526
+ // +required
510
527
Schema VariableSchema `json:"schema"`
511
528
}
512
529
@@ -533,6 +550,7 @@ type VariableSchema struct {
533
550
// openAPIV3Schema defines the schema of a variable via OpenAPI v3
534
551
// schema. The schema is a subset of the schema used in
535
552
// Kubernetes CRDs.
553
+ // +required
536
554
OpenAPIV3Schema JSONSchemaProps `json:"openAPIV3Schema"`
537
555
}
538
556
@@ -543,9 +561,11 @@ type VariableSchema struct {
543
561
// which are not supported in CAPI have been removed.
544
562
type JSONSchemaProps struct {
545
563
// description is a human-readable description of this variable.
564
+ // +optional
546
565
Description string `json:"description,omitempty"`
547
566
548
567
// example is an example for this variable.
568
+ // +optional
549
569
Example * apiextensionsv1.JSON `json:"example,omitempty"`
550
570
551
571
// type is the type of the variable.
@@ -862,9 +882,11 @@ const (
862
882
// ClusterClassPatch defines a patch which is applied to customize the referenced templates.
863
883
type ClusterClassPatch struct {
864
884
// name of the patch.
885
+ // +required
865
886
Name string `json:"name"`
866
887
867
888
// description is a human-readable description of this patch.
889
+ // +optional
868
890
Description string `json:"description,omitempty"`
869
891
870
892
// enabledIf is a Go template to be used to calculate if a patch should be enabled.
@@ -890,11 +912,13 @@ type ClusterClassPatch struct {
890
912
// PatchDefinition defines a patch which is applied to customize the referenced templates.
891
913
type PatchDefinition struct {
892
914
// selector defines on which templates the patch should be applied.
915
+ // +required
893
916
Selector PatchSelector `json:"selector"`
894
917
895
918
// jsonPatches defines the patches which should be applied on the templates
896
919
// matching the selector.
897
920
// Note: Patches will be applied in the order of the array.
921
+ // +required
898
922
JSONPatches []JSONPatch `json:"jsonPatches"`
899
923
}
900
924
@@ -905,12 +929,15 @@ type PatchDefinition struct {
905
929
// Note: The results of selection based on the individual fields are ANDed.
906
930
type PatchSelector struct {
907
931
// apiVersion filters templates by apiVersion.
932
+ // +required
908
933
APIVersion string `json:"apiVersion"`
909
934
910
935
// kind filters templates by kind.
936
+ // +required
911
937
Kind string `json:"kind"`
912
938
913
939
// matchResources selects templates based on where they are referenced.
940
+ // +required
914
941
MatchResources PatchSelectorMatch `json:"matchResources"`
915
942
}
916
943
@@ -959,13 +986,15 @@ type PatchSelectorMatchMachinePoolClass struct {
959
986
type JSONPatch struct {
960
987
// op defines the operation of the patch.
961
988
// Note: Only `add`, `replace` and `remove` are supported.
989
+ // +required
962
990
Op string `json:"op"`
963
991
964
992
// path defines the path of the patch.
965
993
// Note: Only the spec of a template can be patched, thus the path has to start with /spec/.
966
994
// Note: For now the only allowed array modifications are `append` and `prepend`, i.e.:
967
995
// * for op: `add`: only index 0 (prepend) and - (append) are allowed
968
996
// * for op: `replace` or `remove`: no indexes are allowed
997
+ // +required
969
998
Path string `json:"path"`
970
999
971
1000
// value defines the value of the patch.
@@ -1026,6 +1055,7 @@ type ExternalPatchDefinition struct {
1026
1055
type LocalObjectTemplate struct {
1027
1056
// ref is a required reference to a custom resource
1028
1057
// offered by a provider.
1058
+ // +required
1029
1059
Ref * corev1.ObjectReference `json:"ref"`
1030
1060
}
1031
1061
@@ -1065,13 +1095,15 @@ type ClusterClassV1Beta2Status struct {
1065
1095
// ClusterClassStatusVariable defines a variable which appears in the status of a ClusterClass.
1066
1096
type ClusterClassStatusVariable struct {
1067
1097
// name is the name of the variable.
1098
+ // +required
1068
1099
Name string `json:"name"`
1069
1100
1070
1101
// definitionsConflict specifies whether or not there are conflicting definitions for a single variable name.
1071
1102
// +optional
1072
1103
DefinitionsConflict bool `json:"definitionsConflict"`
1073
1104
1074
1105
// definitions is a list of definitions for a variable.
1106
+ // +required
1075
1107
Definitions []ClusterClassStatusVariableDefinition `json:"definitions"`
1076
1108
}
1077
1109
@@ -1080,12 +1112,14 @@ type ClusterClassStatusVariableDefinition struct {
1080
1112
// from specifies the origin of the variable definition.
1081
1113
// This will be `inline` for variables defined in the ClusterClass or the name of a patch defined in the ClusterClass
1082
1114
// for variables discovered from a DiscoverVariables runtime extensions.
1115
+ // +required
1083
1116
From string `json:"from"`
1084
1117
1085
1118
// required specifies if the variable is required.
1086
1119
// Note: this applies to the variable as a whole and thus the
1087
1120
// top-level object defined in the schema. If nested fields are
1088
1121
// required, this will be specified inside the schema.
1122
+ // +required
1089
1123
Required bool `json:"required"`
1090
1124
1091
1125
// metadata is the metadata of a variable.
@@ -1098,6 +1132,7 @@ type ClusterClassStatusVariableDefinition struct {
1098
1132
Metadata ClusterClassVariableMetadata `json:"metadata,omitempty"`
1099
1133
1100
1134
// schema defines the schema of the variable.
1135
+ // +required
1101
1136
Schema VariableSchema `json:"schema"`
1102
1137
}
1103
1138
@@ -1136,8 +1171,10 @@ type ClusterClassList struct {
1136
1171
metav1.TypeMeta `json:",inline"`
1137
1172
// metadata is the standard list's metadata.
1138
1173
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds
1174
+ // +optional
1139
1175
metav1.ListMeta `json:"metadata,omitempty"`
1140
1176
// items is the list of ClusterClasses.
1177
+ // +optional
1141
1178
Items []ClusterClass `json:"items"`
1142
1179
}
1143
1180
0 commit comments