Skip to content

Commit 5b3b936

Browse files
committed
next
Signed-off-by: Andreas Karis <[email protected]>
1 parent 3407094 commit 5b3b936

27 files changed

+277
-272
lines changed

apis/v1alpha1/bpf_application_state_types.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ type BpfApplicationStateStatus struct {
9999
// as a lightweight sequence number to verify that the API server is serving
100100
// the most recent version of the object before beginning a new Reconcile
101101
// operation.
102-
// +kubebuilder:validation:Minimum=0
102+
// +kubebuilder:validation:Minimum=1
103103
// +optional
104-
UpdateCount int64 `json:"updateCount"`
104+
UpdateCount int64 `json:"updateCount,omitempty"`
105105
// node is the name of the Kubernetes node for this BpfApplicationState.
106+
// +kubebuilder:validation:MinLength=1
106107
// +kubebuilder:validation:MaxLength=253
107108
// +optional
108-
Node string `json:"node"`
109+
Node string `json:"node,omitempty"`
109110
// appLoadStatus reflects the status of loading the eBPF application on the
110111
// given node.
111112
//
@@ -128,7 +129,7 @@ type BpfApplicationStateStatus struct {
128129
// UnloadError is returned if one or more programs encountered an error when
129130
// being unloaded.
130131
// +optional
131-
AppLoadStatus AppLoadStatus `json:"appLoadStatus"`
132+
AppLoadStatus AppLoadStatus `json:"appLoadStatus,omitempty"`
132133
// programs is a list of eBPF programs contained in the parent BpfApplication
133134
// instance. Each entry in the list contains the derived program attributes as
134135
// well as the attach status for each program on the given Kubernetes node.

apis/v1alpha1/bpf_application_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type BpfApplicationProgram struct {
3636
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
3737
// +kubebuilder:validation:MinLength=1
3838
// +kubebuilder:validation:MaxLength=64
39-
Name string `json:"name"`
39+
Name string `json:"name,omitempty"`
4040

4141
// type is a required field used to specify the type of the eBPF program.
4242
//
@@ -73,7 +73,7 @@ type BpfApplicationProgram struct {
7373
// +unionDiscriminator
7474
// +required
7575
// +kubebuilder:validation:Enum:="XDP";"TC";"TCX";"UProbe";"URetProbe"
76-
Type EBPFProgType `json:"type"`
76+
Type EBPFProgType `json:"type,omitempty"`
7777

7878
// xdp is an optional field, but required when the type field is set to XDP.
7979
// xdp defines the desired state of the application's XDP programs. XDP program
@@ -163,7 +163,7 @@ type BpfApplicationSpec struct {
163163
// programs in the list to be reloaded, which could be temporarily service
164164
// effecting. For this reason, modifying the list is currently not allowed.
165165
// +required
166-
// +kubebuilder:validation:MinItems:=1
166+
// +kubebuilder:validation:MinItems=1
167167
// +kubebuilder:validation:MaxItems=1023
168168
// +listType=atomic
169169
Programs []BpfApplicationProgram `json:"programs,omitempty"`
@@ -194,7 +194,7 @@ type BpfApplication struct {
194194

195195
// spec defines the desired state of the BpfApplication.
196196
// +required
197-
Spec BpfApplicationSpec `json:"spec,omitempty"`
197+
Spec BpfApplicationSpec `json:"spec,omitzero"`
198198
// status reflects the observed state of the BpfApplication.
199199
// +optional
200200
Status BpfAppStatus `json:"status,omitempty"`

apis/v1alpha1/cluster_bpf_application_state_types.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ type ClBpfApplicationProgramState struct {
7171
// +unionDiscriminator
7272
// +required
7373
// +kubebuilder:validation:Enum:="FEntry";"FExit";"KProbe";"KRetProbe";"TC";"TCX";"TracePoint";"UProbe";"URetProbe";"XDP"
74-
Type EBPFProgType `json:"type"`
74+
Type EBPFProgType `json:"type,omitempty"`
7575

7676
// xdp contains the attachment data for an XDP program when type is set to XDP.
7777
// +unionMember
@@ -150,12 +150,14 @@ type ClBpfApplicationStateStatus struct {
150150
// as a lightweight sequence number to verify that the API server is serving
151151
// the most recent version of the object before beginning a new Reconcile
152152
// operation.
153+
// +kubebuilder:validation:Minimum=1
153154
// +optional
154-
UpdateCount int64 `json:"updateCount"`
155+
UpdateCount int64 `json:"updateCount,omitempty"`
155156
// node is the name of the Kubernetes node for this ClusterBpfApplicationState.
157+
// +kubebuilder:validation:MinLength=1
156158
// +kubebuilder:validation:MaxLength=253
157159
// +optional
158-
Node string `json:"node"`
160+
Node string `json:"node,omitempty"`
159161
// appLoadStatus reflects the status of loading the eBPF application on the
160162
// given node.
161163
//
@@ -176,7 +178,7 @@ type ClBpfApplicationStateStatus struct {
176178
// UnloadError is returned if one or more programs encountered an error when
177179
// being unloaded.
178180
// +optional
179-
AppLoadStatus AppLoadStatus `json:"appLoadStatus"`
181+
AppLoadStatus AppLoadStatus `json:"appLoadStatus,omitempty"`
180182
// programs is a list of eBPF programs contained in the parent
181183
// ClusterBpfApplication instance. Each entry in the list contains the derived
182184
// program attributes as well as the attach status for each program on the

apis/v1alpha1/cluster_bpf_application_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ type ClBpfApplicationProgram struct {
8282
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
8383
// +kubebuilder:validation:MinLength=1
8484
// +kubebuilder:validation:MaxLength=64
85-
Name string `json:"name"`
85+
Name string `json:"name,omitempty"`
8686

8787
// type is a required field used to specify the type of the eBPF program.
8888
//
@@ -143,7 +143,7 @@ type ClBpfApplicationProgram struct {
143143
// +unionDiscriminator
144144
// +required
145145
// +kubebuilder:validation:Enum:="XDP";"TC";"TCX";"FEntry";"FExit";"KProbe";"KRetProbe";"UProbe";"URetProbe";"TracePoint"
146-
Type EBPFProgType `json:"type"`
146+
Type EBPFProgType `json:"type,omitempty"`
147147

148148
// xdp is an optional field, but required when the type field is set to XDP.
149149
// xdp defines the desired state of the application's XDP programs. XDP program
@@ -325,7 +325,7 @@ type ClusterBpfApplication struct {
325325

326326
// spec defines the desired state of the BpfApplication.
327327
// +required
328-
Spec ClBpfApplicationSpec `json:"spec,omitempty"`
328+
Spec ClBpfApplicationSpec `json:"spec,omitzero"`
329329
// status reflects the observed state of the BpfApplication.
330330
// +optional
331331
Status BpfAppStatus `json:"status,omitempty"`

apis/v1alpha1/cluster_fentry_program_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type ClFentryLoadInfo struct {
4040
// function to attach the FEntry program. function must not be an empty string,
4141
// must not exceed 64 characters in length, must start with alpha characters
4242
// and must only contain alphanumeric characters.
43-
// +required
43+
// +optional
4444
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
4545
// +kubebuilder:validation:MinLength=1
4646
// +kubebuilder:validation:MaxLength=64
@@ -58,7 +58,7 @@ type ClFentryAttachInfo struct {
5858
// attempt to be attached. To detach the FEntry program, remove the link entry.
5959
// +required
6060
// +kubebuilder:validation:Enum=Attach;
61-
Mode AttachTypeAttach `json:"mode"`
61+
Mode AttachTypeAttach `json:"mode,omitempty"`
6262
}
6363

6464
type ClFentryProgramInfoState struct {

apis/v1alpha1/cluster_fexit_program_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type ClFexitLoadInfo struct {
4141
// must be between 1 and 64 characters in length, must start with alpha
4242
// characters and must only contain alphanumeric characters and underscores.
4343
// The pattern ^[a-zA-Z][a-zA-Z0-9_]+. is enforced.
44-
// +required
44+
// +optional
4545
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
4646
// +kubebuilder:validation:MinLength=1
4747
// +kubebuilder:validation:MaxLength=64
@@ -53,7 +53,7 @@ type ClFexitAttachInfo struct {
5353
// attempt to be attached. To detach the FExit program, remove the link entry.
5454
// +required
5555
// +kubebuilder:validation:Enum=Attach;
56-
Mode AttachTypeAttach `json:"mode"`
56+
Mode AttachTypeAttach `json:"mode,omitempty"`
5757
}
5858

5959
type ClFexitProgramInfoState struct {

apis/v1alpha1/cluster_kprobe_program_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type ClKprobeAttachInfoState struct {
7777
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
7878
// +kubebuilder:validation:MinLength=1
7979
// +kubebuilder:validation:MaxLength=64
80-
Function string `json:"function"`
80+
Function string `json:"function,omitempty"`
8181

8282
// offset is the provisioned offset, whose value is added to the address of the
8383
// attachment point function.

apis/v1alpha1/cluster_kretprobe_program_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type ClKretprobeAttachInfo struct {
4343
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
4444
// +kubebuilder:validation:MinLength=1
4545
// +kubebuilder:validation:MaxLength=64
46-
Function string `json:"function"`
46+
Function string `json:"function,omitempty"`
4747
}
4848

4949
type ClKretprobeProgramInfoState struct {
@@ -68,5 +68,5 @@ type ClKretprobeAttachInfoState struct {
6868
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
6969
// +kubebuilder:validation:MinLength=1
7070
// +kubebuilder:validation:MaxLength=64
71-
Function string `json:"function"`
71+
Function string `json:"function,omitempty"`
7272
}

apis/v1alpha1/cluster_tc_program_types.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type ClTcAttachInfo struct {
4646
// by providing a list of interface names, enabling auto discovery, or setting
4747
// the primaryNodeInterface flag, but only one option is allowed.
4848
// +required
49-
InterfaceSelector InterfaceSelector `json:"interfaceSelector"`
49+
InterfaceSelector InterfaceSelector `json:"interfaceSelector,omitzero"`
5050

5151
// networkNamespaces is an optional field that identifies the set of network
5252
// namespaces in which to attach the eBPF program. If networkNamespaces is not
@@ -114,20 +114,22 @@ type ClTcAttachInfoState struct {
114114
// interfaceName is the name of the interface the TC program should be
115115
// attached.
116116
// +required
117+
// +kubebuilder:validation:MinLength=1
117118
// +kubebuilder:validation:MaxLength=63
118-
InterfaceName string `json:"interfaceName"`
119+
InterfaceName string `json:"interfaceName,omitempty"`
119120

120121
// netnsPath is the optional path to the network namespace inside of which the
121122
// TC program should be attached.
122123
// +optional
124+
// +kubebuilder:validation:MinLength=1
123125
// +kubebuilder:validation:MaxLength=1023
124126
NetnsPath string `json:"netnsPath,omitempty"`
125127

126128
// direction is the provisioned direction of traffic, Ingress or Egress, the TC
127129
// program should be attached for a given network device.
128130
// +required
129131
// +kubebuilder:validation:Enum=Ingress;Egress
130-
Direction TCDirectionType `json:"direction"`
132+
Direction TCDirectionType `json:"direction,omitempty"`
131133

132134
// priority is the provisioned priority of the TC program in relation to other
133135
// programs of the same type with the same attach point. It is a value from 0
@@ -143,5 +145,5 @@ type ClTcAttachInfoState struct {
143145
// +required
144146
// +kubebuilder:validation:MaxItems=1023
145147
// +listType=atomic
146-
ProceedOn []TcProceedOnValue `json:"proceedOn"`
148+
ProceedOn []TcProceedOnValue `json:"proceedOn,omitempty"`
147149
}

apis/v1alpha1/cluster_tcx_program_types.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type ClTcxAttachInfo struct {
4444
// by providing a list of interface names, enabling auto discovery, or setting
4545
// the primaryNodeInterface flag, but only one option is allowed.
4646
// +required
47-
InterfaceSelector InterfaceSelector `json:"interfaceSelector"`
47+
InterfaceSelector InterfaceSelector `json:"interfaceSelector,omitzero"`
4848

4949
// networkNamespaces is an optional field that identifies the set of network
5050
// namespaces in which to attach the eBPF program. If networkNamespaces is not
@@ -63,7 +63,7 @@ type ClTcxAttachInfo struct {
6363
// transmitted by the interface.
6464
// +required
6565
// +kubebuilder:validation:Enum=Ingress;Egress
66-
Direction TCDirectionType `json:"direction"`
66+
Direction TCDirectionType `json:"direction,omitempty"`
6767

6868
// priority is an optional field and determines the execution order of the TCX
6969
// program relative to other TCX programs attached to the same attachment
@@ -96,21 +96,23 @@ type ClTcxAttachInfoState struct {
9696
// interfaceName is the name of the interface the TCX program should be
9797
// attached. interfaceName must not exceed 63 characters in length.
9898
// +required
99+
// +kubebuilder:validation:MinLength=1
99100
// +kubebuilder:validation:MaxLength=63
100-
InterfaceName string `json:"interfaceName"`
101+
InterfaceName string `json:"interfaceName,omitempty"`
101102

102103
// netnsPath is the optional path to the network namespace inside of which the
103104
// TCX program should be attached. If not provided, the default network
104105
// namespace is used. netnsPath must not exceed 1023 characters in length.
105106
// +optional
107+
// +kubebuilder:validation:MinLength=1
106108
// +kubebuilder:validation:MaxLength=1023
107109
NetnsPath string `json:"netnsPath,omitempty"`
108110

109111
// direction is the provisioned direction of traffic, Ingress or Egress, the TC
110112
// program should be attached for a given network device.
111113
// +required
112114
// +kubebuilder:validation:Enum=Ingress;Egress
113-
Direction TCDirectionType `json:"direction"`
115+
Direction TCDirectionType `json:"direction,omitempty"`
114116

115117
// priority is the provisioned priority of the TCX program in relation to other
116118
// programs of the same type with the same attach point. It is a value from 0

0 commit comments

Comments
 (0)