Skip to content

Commit c13e5fe

Browse files
authored
Mark status fields as optional (#129)
Issue N/A Description of changes: - Mark status fields as optional using `+kubebuilder:validation:Optional` marker comment By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent a8283f5 commit c13e5fe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

templates/apis/crd.go.tpl

+3
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,19 @@ type {{ .CRD.Kind }}Status struct {
3030
// All CRs managed by ACK have a common `Status.ACKResourceMetadata` member
3131
// that is used to contain resource sync state, account ownership,
3232
// constructed ARN for the resource
33+
// +kubebuilder:validation:Optional
3334
ACKResourceMetadata *ackv1alpha1.ResourceMetadata `json:"ackResourceMetadata"`
3435
// All CRS managed by ACK have a common `Status.Conditions` member that
3536
// contains a collection of `ackv1alpha1.Condition` objects that describe
3637
// the various terminal states of the CR and its backend AWS service API
3738
// resource
39+
// +kubebuilder:validation:Optional
3840
Conditions []*ackv1alpha1.Condition `json:"conditions"`
3941
{{- range $fieldName, $field := .CRD.StatusFields }}
4042
{{- if $field.ShapeRef }}
4143
{{ $field.ShapeRef.Documentation }}
4244
{{- end }}
45+
// +kubebuilder:validation:Optional
4346
{{ $field.Names.Camel }} {{ $field.GoType }} `json:"{{ $field.Names.CamelLower }},omitempty"`
4447
{{- end }}
4548
}

0 commit comments

Comments
 (0)