From 47e39fbf5befd59e1f8254b0bbb97bab1f9abf2d Mon Sep 17 00:00:00 2001 From: oilbeater Date: Tue, 2 Aug 2022 14:47:27 +0800 Subject: [PATCH] fix: add omitempty to subnet spec --- hack/update-codegen-docker.sh | 0 pkg/apis/kubeovn/v1/types.go | 28 ++++++++++++++-------------- 2 files changed, 14 insertions(+), 14 deletions(-) mode change 100644 => 100755 hack/update-codegen-docker.sh diff --git a/hack/update-codegen-docker.sh b/hack/update-codegen-docker.sh old mode 100644 new mode 100755 diff --git a/pkg/apis/kubeovn/v1/types.go b/pkg/apis/kubeovn/v1/types.go index a7bfbe7744c..876fd6a6166 100644 --- a/pkg/apis/kubeovn/v1/types.go +++ b/pkg/apis/kubeovn/v1/types.go @@ -101,24 +101,24 @@ type Subnet struct { } type SubnetSpec struct { - Default bool `json:"default"` + Default bool `json:"default,omitempty"` Vpc string `json:"vpc,omitempty"` - Protocol string `json:"protocol"` + Protocol string `json:"protocol,omitempty"` Namespaces []string `json:"namespaces,omitempty"` CIDRBlock string `json:"cidrBlock"` Gateway string `json:"gateway"` ExcludeIps []string `json:"excludeIps,omitempty"` Provider string `json:"provider,omitempty"` - GatewayType string `json:"gatewayType"` - GatewayNode string `json:"gatewayNode"` - NatOutgoing bool `json:"natOutgoing"` + GatewayType string `json:"gatewayType,omitempty"` + GatewayNode string `json:"gatewayNode,omitempty"` + NatOutgoing bool `json:"natOutgoing,omitempty"` ExternalEgressGateway string `json:"externalEgressGateway,omitempty"` PolicyRoutingPriority uint32 `json:"policyRoutingPriority,omitempty"` PolicyRoutingTableID uint32 `json:"policyRoutingTableID,omitempty"` - Private bool `json:"private"` + Private bool `json:"private,omitempty"` AllowSubnets []string `json:"allowSubnets,omitempty"` Vlan string `json:"vlan,omitempty"` @@ -126,16 +126,16 @@ type SubnetSpec struct { Vips []string `json:"vips,omitempty"` - LogicalGateway bool `json:"logicalGateway"` - DisableGatewayCheck bool `json:"disableGatewayCheck"` - DisableInterConnection bool `json:"disableInterConnection"` + LogicalGateway bool `json:"logicalGateway,omitempty"` + DisableGatewayCheck bool `json:"disableGatewayCheck,omitempty"` + DisableInterConnection bool `json:"disableInterConnection,omitempty"` - EnableDHCP bool `json:"enableDHCP"` - DHCPv4Options string `json:"dhcpV4Options"` - DHCPv6Options string `json:"dhcpV6Options"` + EnableDHCP bool `json:"enableDHCP,omitempty"` + DHCPv4Options string `json:"dhcpV4Options,omitempty"` + DHCPv6Options string `json:"dhcpV6Options,omitempty"` - EnableIPv6RA bool `json:"enableIPv6RA"` - IPv6RAConfigs string `json:"ipv6RAConfigs"` + EnableIPv6RA bool `json:"enableIPv6RA,omitempty"` + IPv6RAConfigs string `json:"ipv6RAConfigs,omitempty"` Acls []Acl `json:"acls,omitempty"` }