You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by zh...@apache.org on 2021/08/13 06:05:28 UTC

[apisix-ingress-controller] branch master updated: fix field tag omiteempty (#622)

This is an automated email from the ASF dual-hosted git repository.

zhangjintao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
     new 91d985e  fix field tag omiteempty (#622)
91d985e is described below

commit 91d985edca67493acc22536c66d4947fe597052f
Author: chen zhuo <ch...@126.com>
AuthorDate: Fri Aug 13 14:05:21 2021 +0800

    fix field tag omiteempty (#622)
    
    Co-authored-by: zhuo.chen <zh...@upai.com>
---
 pkg/kube/apisix/apis/config/v2alpha1/types.go | 8 ++++----
 pkg/kube/apisix/apis/config/v2beta1/types.go  | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/pkg/kube/apisix/apis/config/v2alpha1/types.go b/pkg/kube/apisix/apis/config/v2alpha1/types.go
index f5d08c2..44b24b8 100644
--- a/pkg/kube/apisix/apis/config/v2alpha1/types.go
+++ b/pkg/kube/apisix/apis/config/v2alpha1/types.go
@@ -92,11 +92,11 @@ type ApisixRouteHTTP struct {
 	Priority int                   `json:"priority,omitempty" yaml:"priority,omitempty"`
 	Match    *ApisixRouteHTTPMatch `json:"match,omitempty" yaml:"match,omitempty"`
 	// Deprecated: Backend will be removed in the future, use Backends instead.
-	Backend *ApisixRouteHTTPBackend `json:"backend" yaml:"backend"`
+	Backend *ApisixRouteHTTPBackend `json:"backend,omitempty" yaml:"backend,omitempty"`
 	// Backends represents potential backends to proxy after the route
 	// rule matched. When number of backends are more than one, traffic-split
 	// plugin in APISIX will be used to split traffic based on the backend weight.
-	Backends       []*ApisixRouteHTTPBackend  `json:"backends" yaml:"backends"`
+	Backends       []*ApisixRouteHTTPBackend  `json:"backends,omitempty" yaml:"backends,omitempty"`
 	Websocket      bool                       `json:"websocket" yaml:"websocket"`
 	Plugins        []*ApisixRouteHTTPPlugin   `json:"plugins,omitempty" yaml:"plugins,omitempty"`
 	Authentication *ApisixRouteAuthentication `json:"authentication,omitempty" yaml:"authentication,omitempty"`
@@ -172,12 +172,12 @@ type ApisixRouteHTTPBackend struct {
 	// when set to "endpoints", the pod ips will be used; other
 	// wise, the service ClusterIP or ExternalIP will be used,
 	// default is endpoints.
-	ResolveGranularity string `json:"resolveGranularity" yaml:"resolveGranularity"`
+	ResolveGranularity string `json:"resolveGranularity,omitempty" yaml:"resolveGranularity,omitempty"`
 	// Weight of this backend.
 	Weight *int `json:"weight" yaml:"weight"`
 	// Subset specifies a subset for the target Service. The subset should be pre-defined
 	// in ApisixUpstream about this service.
-	Subset string `json:"subset" yaml:"subset"`
+	Subset string `json:"subset,omitempty" yaml:"subset,omitempty"`
 }
 
 // ApisixRouteHTTPPlugin represents an APISIX plugin.
diff --git a/pkg/kube/apisix/apis/config/v2beta1/types.go b/pkg/kube/apisix/apis/config/v2beta1/types.go
index 21eb5f6..2bdfe7f 100644
--- a/pkg/kube/apisix/apis/config/v2beta1/types.go
+++ b/pkg/kube/apisix/apis/config/v2beta1/types.go
@@ -55,11 +55,11 @@ type ApisixRouteHTTP struct {
 	Priority int                  `json:"priority,omitempty" yaml:"priority,omitempty"`
 	Match    ApisixRouteHTTPMatch `json:"match,omitempty" yaml:"match,omitempty"`
 	// Deprecated: Backend will be removed in the future, use Backends instead.
-	Backend v2alpha1.ApisixRouteHTTPBackend `json:"backend" yaml:"backend"`
+	Backend v2alpha1.ApisixRouteHTTPBackend `json:"backend,omitempty" yaml:"backend,omitempty"`
 	// Backends represents potential backends to proxy after the route
 	// rule matched. When number of backends are more than one, traffic-split
 	// plugin in APISIX will be used to split traffic based on the backend weight.
-	Backends       []v2alpha1.ApisixRouteHTTPBackend `json:"backends" yaml:"backends"`
+	Backends       []v2alpha1.ApisixRouteHTTPBackend `json:"backends,omitempty" yaml:"backends,omitempty"`
 	Websocket      bool                              `json:"websocket" yaml:"websocket"`
 	Plugins        []ApisixRouteHTTPPlugin           `json:"plugins,omitempty" yaml:"plugins,omitempty"`
 	Authentication ApisixRouteAuthentication         `json:"authentication,omitempty" yaml:"authentication,omitempty"`
@@ -175,10 +175,10 @@ type ApisixRouteStreamBackend struct {
 	// when set to "endpoints", the pod ips will be used; other
 	// wise, the service ClusterIP or ExternalIP will be used,
 	// default is endpoints.
-	ResolveGranularity string `json:"resolveGranularity" yaml:"resolveGranularity"`
+	ResolveGranularity string `json:"resolveGranularity,omitempty" yaml:"resolveGranularity,omitempty"`
 	// Subset specifies a subset for the target Service. The subset should be pre-defined
 	// in ApisixUpstream about this service.
-	Subset string `json:"subset" yaml:"subset"`
+	Subset string `json:"subset,omitempty" yaml:"subset,omitempty"`
 }
 
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object