From 935d6f97464da36ff1629f3cd7175fa47bdb3365 Mon Sep 17 00:00:00 2001 From: Henry Tam Date: Mon, 25 Mar 2024 23:15:28 +1100 Subject: [PATCH] Add omitempty to statuses to allow better marshalling. Signed-off-by: Henry Tam --- pkg/apis/flagger/v1beta1/alert.go | 2 +- pkg/apis/flagger/v1beta1/canary.go | 2 +- pkg/apis/flagger/v1beta1/metric.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/apis/flagger/v1beta1/alert.go b/pkg/apis/flagger/v1beta1/alert.go index baabb8987..e995ee6d0 100644 --- a/pkg/apis/flagger/v1beta1/alert.go +++ b/pkg/apis/flagger/v1beta1/alert.go @@ -34,7 +34,7 @@ type AlertProvider struct { metav1.ObjectMeta `json:"metadata,omitempty"` Spec AlertProviderSpec `json:"spec"` - Status AlertProviderStatus `json:"status"` + Status AlertProviderStatus `json:"status,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/flagger/v1beta1/canary.go b/pkg/apis/flagger/v1beta1/canary.go index 54ae27061..3b4c5ca29 100644 --- a/pkg/apis/flagger/v1beta1/canary.go +++ b/pkg/apis/flagger/v1beta1/canary.go @@ -46,7 +46,7 @@ type Canary struct { metav1.ObjectMeta `json:"metadata,omitempty"` Spec CanarySpec `json:"spec"` - Status CanaryStatus `json:"status"` + Status CanaryStatus `json:"status,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/flagger/v1beta1/metric.go b/pkg/apis/flagger/v1beta1/metric.go index 86b46959e..aef96c6cd 100644 --- a/pkg/apis/flagger/v1beta1/metric.go +++ b/pkg/apis/flagger/v1beta1/metric.go @@ -36,7 +36,7 @@ type MetricTemplate struct { metav1.ObjectMeta `json:"metadata,omitempty"` Spec MetricTemplateSpec `json:"spec"` - Status MetricTemplateStatus `json:"status"` + Status MetricTemplateStatus `json:"status,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object