From c9e820aa5863c13bc5fccf9fa2ac741142755310 Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Tue, 20 Jul 2021 18:51:28 +0200 Subject: [PATCH] Mark CR status fields as optional --- templates/apis/crd.go.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/apis/crd.go.tpl b/templates/apis/crd.go.tpl index 68584f4d..56e2dd59 100644 --- a/templates/apis/crd.go.tpl +++ b/templates/apis/crd.go.tpl @@ -30,16 +30,19 @@ type {{ .CRD.Kind }}Status struct { // All CRs managed by ACK have a common `Status.ACKResourceMetadata` member // that is used to contain resource sync state, account ownership, // constructed ARN for the resource + // +kubebuilder:validation:Optional ACKResourceMetadata *ackv1alpha1.ResourceMetadata `json:"ackResourceMetadata"` // All CRS managed by ACK have a common `Status.Conditions` member that // contains a collection of `ackv1alpha1.Condition` objects that describe // the various terminal states of the CR and its backend AWS service API // resource + // +kubebuilder:validation:Optional Conditions []*ackv1alpha1.Condition `json:"conditions"` {{- range $fieldName, $field := .CRD.StatusFields }} {{- if $field.ShapeRef }} {{ $field.ShapeRef.Documentation }} {{- end }} + // +kubebuilder:validation:Optional {{ $field.Names.Camel }} {{ $field.GoType }} `json:"{{ $field.Names.CamelLower }},omitempty"` {{- end }} }