Skip to content

Commit b7a3438

Browse files
committed
chore: revert spurious omitempty changes
and rename ExternalL2Spec to ExternalL2 as requested Signed-off-by: Emanuele Di Pascale <[email protected]>
1 parent e3a46ec commit b7a3438

File tree

6 files changed

+19
-27
lines changed

6 files changed

+19
-27
lines changed

api/vpc/v1beta1/external_types.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var communityCheck = regexp.MustCompile("^(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|6
3636

3737
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
3838

39-
type ExternalL2Spec struct {
39+
type ExternalL2 struct {
4040
// Prefixes is the list of IPv4 prefixes reachable via the external
4141
Prefixes []string `json:"prefixes,omitempty"`
4242
}
@@ -52,7 +52,7 @@ type ExternalSpec struct {
5252
OutboundCommunity string `json:"outboundCommunity,omitempty"`
5353
// L2 contains L2 specific parameters
5454
// +optional
55-
L2 *ExternalL2Spec `json:"l2,omitempty"`
55+
L2 *ExternalL2 `json:"l2,omitempty"`
5656
}
5757

5858
// ExternalStatus defines the observed state of External
@@ -69,24 +69,21 @@ type ExternalStatus struct{}
6969
// Users can do external peering with the external system by specifying the name of the External Object without need to
7070
// worry about the details of how external system is attached to the Fabric.
7171
type External struct {
72-
kmetav1.TypeMeta `json:",inline"`
73-
// +optional
74-
kmetav1.ObjectMeta `json:"metadata"`
72+
kmetav1.TypeMeta `json:",inline"`
73+
kmetav1.ObjectMeta `json:"metadata,omitempty"`
7574

7675
// Spec is the desired state of the External
77-
Spec ExternalSpec `json:"spec"`
76+
Spec ExternalSpec `json:"spec,omitempty"`
7877
// Status is the observed state of the External
79-
// +optional
80-
Status ExternalStatus `json:"status"`
78+
Status ExternalStatus `json:"status,omitempty"`
8179
}
8280

8381
//+kubebuilder:object:root=true
8482

8583
// ExternalList contains a list of External
8684
type ExternalList struct {
8785
kmetav1.TypeMeta `json:",inline"`
88-
// +optional
89-
kmetav1.ListMeta `json:"metadata"`
86+
kmetav1.ListMeta `json:"metadata,omitempty"`
9087
Items []External `json:"items"`
9188
}
9289

api/vpc/v1beta1/externalattachment_types.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,21 @@ type ExternalAttachmentStatus struct{}
8989
// ExternalAttachment is a definition of how specific switch is connected with external system (External object).
9090
// Effectively it represents BGP peering between the switch and external system including all needed configuration.
9191
type ExternalAttachment struct {
92-
kmetav1.TypeMeta `json:",inline"`
93-
// +optional
94-
kmetav1.ObjectMeta `json:"metadata"`
92+
kmetav1.TypeMeta `json:",inline"`
93+
kmetav1.ObjectMeta `json:"metadata,omitempty"`
9594

9695
// Spec is the desired state of the ExternalAttachment
9796
Spec ExternalAttachmentSpec `json:"spec"`
9897
// Status is the observed state of the ExternalAttachment
99-
// +optional
100-
Status ExternalAttachmentStatus `json:"status"`
98+
Status ExternalAttachmentStatus `json:"status,omitempty"`
10199
}
102100

103101
//+kubebuilder:object:root=true
104102

105103
// ExternalAttachmentList contains a list of ExternalAttachment
106104
type ExternalAttachmentList struct {
107105
kmetav1.TypeMeta `json:",inline"`
108-
// +optional
109-
kmetav1.ListMeta `json:"metadata"`
106+
kmetav1.ListMeta `json:"metadata,omitempty"`
110107
Items []ExternalAttachment `json:"items"`
111108
}
112109

api/vpc/v1beta1/externalattachment_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func TestExternalAttachmentValidation(t *testing.T) {
9494
},
9595
Spec: v1beta1.ExternalSpec{
9696
IPv4Namespace: "default",
97-
L2: &v1beta1.ExternalL2Spec{
97+
L2: &v1beta1.ExternalL2{
9898
Prefixes: []string{"0.0.0.0/0"},
9999
},
100100
},

api/vpc/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/vpc.githedgehog.com_externals.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ spec:
8787
status:
8888
description: Status is the observed state of the External
8989
type: object
90-
required:
91-
- spec
9290
type: object
9391
served: true
9492
storage: true

docs/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ _Appears in:_
935935
| `ip` _string_ | IP is the IP address of the subinterface on a switch port specified in the connection, it should include the prefix length | | |
936936

937937

938-
#### ExternalL2Spec
938+
#### ExternalL2
939939

940940

941941

@@ -1083,7 +1083,7 @@ _Appears in:_
10831083
| `ipv4Namespace` _string_ | IPv4Namespace is the name of the IPv4Namespace this External belongs to | | |
10841084
| `inboundCommunity` _string_ | InboundCommunity is the inbound community to filter routes from the external system (e.g. 65102:5000) | | |
10851085
| `outboundCommunity` _string_ | OutboundCommunity is theoutbound community that all outbound routes will be stamped with (e.g. 50000:50001) | | |
1086-
| `l2` _[ExternalL2Spec](#externall2spec)_ | L2 contains L2 specific parameters | | |
1086+
| `l2` _[ExternalL2](#externall2)_ | L2 contains L2 specific parameters | | |
10871087

10881088

10891089
#### ExternalStatus

0 commit comments

Comments
 (0)