Skip to content

Commit b26b2a7

Browse files
committed
next-api-change
Signed-off-by: Andreas Karis <[email protected]>
1 parent a3d2ff5 commit b26b2a7

18 files changed

+221
-149
lines changed

apis/v1alpha1/bpf_application_state_types.go

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type BpfApplicationProgramState struct {
5050
// +unionDiscriminator
5151
// +required
5252
// +kubebuilder:validation:Enum:="XDP";"TC";"TCX";"UProbe";"URetProbe"
53-
Type EBPFProgType `json:"type"`
53+
Type EBPFProgType `json:"type,omitempty"`
5454

5555
// xdp contains the attachment data for an XDP program when type is set to XDP.
5656
// +unionMember
@@ -81,14 +81,29 @@ type BpfApplicationProgramState struct {
8181
}
8282

8383
type BpfApplicationStateStatus struct {
84-
// UpdateCount tracks the number of times the BpfApplicationState object has
84+
// conditions contains the summary state of the BpfApplication for the given
85+
// Kubernetes node. If one or more programs failed to load or attach to the
86+
// designated attachment point, the condition will report the error. If more
87+
// than one error has occurred, condition will contain the first error
88+
// encountered.
89+
// +patchMergeKey=type
90+
// +patchStrategy=merge
91+
// +listType=map
92+
// +listMapKey=type
93+
// +optional
94+
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
95+
// updateCount tracks the number of times the BpfApplicationState object has
8596
// been updated. The bpfman agent initializes it to 1 when it creates the
8697
// object, and then increments it before each subsequent update. It serves
8798
// as a lightweight sequence number to verify that the API server is serving
8899
// the most recent version of the object before beginning a new Reconcile
89100
// operation.
101+
// +kubebuilder:validation:Minimum=0
102+
// +optional
90103
UpdateCount int64 `json:"updateCount"`
91104
// node is the name of the Kubernets node for this BpfApplicationState.
105+
// +kubebuilder:validation:MaxLength=253
106+
// +optional
92107
Node string `json:"node"`
93108
// appLoadStatus reflects the status of loading the eBPF application on the
94109
// given node.
@@ -111,21 +126,15 @@ type BpfApplicationStateStatus struct {
111126
//
112127
// UnloadError is returned if one or more programs encountered an error when
113128
// being unloaded.
129+
// +optional
114130
AppLoadStatus AppLoadStatus `json:"appLoadStatus"`
115131
// programs is a list of eBPF programs contained in the parent BpfApplication
116132
// instance. Each entry in the list contains the derived program attributes as
117133
// well as the attach status for each program on the given Kubernetes node.
134+
// +kubebuilder:validation:MaxItems=1023
135+
// +listType=atomic
136+
// +optional
118137
Programs []BpfApplicationProgramState `json:"programs,omitempty"`
119-
// conditions contains the summary state of the BpfApplication for the given
120-
// Kubernetes node. If one or more programs failed to load or attach to the
121-
// designated attachment point, the condition will report the error. If more
122-
// than one error has occurred, condition will contain the first error
123-
// encountered.
124-
// +patchMergeKey=type
125-
// +patchStrategy=merge
126-
// +listType=map
127-
// +listMapKey=type
128-
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
129138
}
130139

131140
// +genclient
@@ -141,13 +150,16 @@ type BpfApplicationStateStatus struct {
141150
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`
142151
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
143152
type BpfApplicationState struct {
144-
metav1.TypeMeta `json:",inline"`
153+
metav1.TypeMeta `json:",inline"`
154+
// metadata is the object's metadata.
155+
// +optional
145156
metav1.ObjectMeta `json:"metadata,omitempty"`
146157

147158
// status reflects the status of a BpfApplication instance for the given node.
148159
// appLoadStatus and conditions provide an overall status for the given node,
149160
// while each item in the programs list provides a per eBPF program status for
150161
// the given node.
162+
// +optional
151163
Status BpfApplicationStateStatus `json:"status,omitempty"`
152164
}
153165

apis/v1alpha1/bpf_application_types.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type BpfApplicationProgram struct {
3131
// name is a required field and is the name of the function that is the entry
3232
// point for the eBPF program. name must not be an empty string, must not
3333
// exceed 64 characters in length, must start with alpha characters and must
34-
// only contain alphanumeric characters.
34+
// only contain alphanumeric characters and underscores.
3535
// +required
3636
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
3737
// +kubebuilder:validation:MinLength=1
@@ -164,6 +164,8 @@ type BpfApplicationSpec struct {
164164
// effecting. For this reason, modifying the list is currently not allowed.
165165
// +required
166166
// +kubebuilder:validation:MinItems:=1
167+
// +kubebuilder:validation:MaxItems=1023
168+
// +listType=atomic
167169
Programs []BpfApplicationProgram `json:"programs,omitempty"`
168170
}
169171

@@ -185,11 +187,17 @@ type BpfApplicationSpec struct {
185187
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`
186188
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
187189
type BpfApplication struct {
188-
metav1.TypeMeta `json:",inline"`
190+
metav1.TypeMeta `json:",inline"`
191+
// metadata is the object's metadata.
192+
// +optional
189193
metav1.ObjectMeta `json:"metadata,omitempty"`
190194

191-
Spec BpfApplicationSpec `json:"spec,omitempty"`
192-
Status BpfAppStatus `json:"status,omitempty"`
195+
// spec defines the desired state of the BpfApplication.
196+
// +required
197+
Spec BpfApplicationSpec `json:"spec,omitempty"`
198+
// status reflects the observed state of the BpfApplication.
199+
// +optional
200+
Status BpfAppStatus `json:"status,omitempty"`
193201
}
194202

195203
// +kubebuilder:object:root=true

apis/v1alpha1/cluster_bpf_application_state_types.go

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,28 @@ type ClBpfApplicationProgramState struct {
132132
}
133133

134134
type ClBpfApplicationStateStatus struct {
135-
// UpdateCount tracks the number of times the BpfApplicationState object has
135+
// conditions contains the summary state of the ClusterBpfApplication for the
136+
// given Kubernetes node. If one or more programs failed to load or attach to
137+
// the designated attachment point, the condition will report the error. If
138+
// more than one error has occurred, condition will contain the first error
139+
// encountered.
140+
// +patchMergeKey=type
141+
// +patchStrategy=merge
142+
// +listType=map
143+
// +listMapKey=type
144+
// +optional
145+
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
146+
// updateCount tracks the number of times the BpfApplicationState object has
136147
// been updated. The bpfman agent initializes it to 1 when it creates the
137148
// object, and then increments it before each subsequent update. It serves
138149
// as a lightweight sequence number to verify that the API server is serving
139150
// the most recent version of the object before beginning a new Reconcile
140151
// operation.
152+
// +optional
141153
UpdateCount int64 `json:"updateCount"`
142154
// node is the name of the Kubernetes node for this ClusterBpfApplicationState.
155+
// +kubebuilder:validation:MaxLength=253
156+
// +optional
143157
Node string `json:"node"`
144158
// appLoadStatus reflects the status of loading the eBPF application on the
145159
// given node.
@@ -160,22 +174,16 @@ type ClBpfApplicationStateStatus struct {
160174
//
161175
// UnloadError is returned if one or more programs encountered an error when
162176
// being unloaded.
177+
// +optional
163178
AppLoadStatus AppLoadStatus `json:"appLoadStatus"`
164179
// programs is a list of eBPF programs contained in the parent
165180
// ClusterBpfApplication instance. Each entry in the list contains the derived
166181
// program attributes as well as the attach status for each program on the
167182
// given Kubernetes node.
183+
// +kubebuilder:validation:MaxItems=1023
184+
// +listType=atomic
185+
// +optional
168186
Programs []ClBpfApplicationProgramState `json:"programs,omitempty"`
169-
// conditions contains the summary state of the ClusterBpfApplication for the
170-
// given Kubernetes node. If one or more programs failed to load or attach to
171-
// the designated attachment point, the condition will report the error. If
172-
// more than one error has occurred, condition will contain the first error
173-
// encountered.
174-
// +patchMergeKey=type
175-
// +patchStrategy=merge
176-
// +listType=map
177-
// +listMapKey=type
178-
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
179187
}
180188

181189
// +genclient
@@ -192,13 +200,16 @@ type ClBpfApplicationStateStatus struct {
192200
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`
193201
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
194202
type ClusterBpfApplicationState struct {
195-
metav1.TypeMeta `json:",inline"`
203+
metav1.TypeMeta `json:",inline"`
204+
// metadata is the object's metadata.
205+
// +optional
196206
metav1.ObjectMeta `json:"metadata,omitempty"`
197207

198208
// status reflects the status of a ClusterBpfApplication instance for the given
199209
// node. appLoadStatus and conditions provide an overall status for the given
200210
// node, while each item in the programs list provides a per eBPF program
201211
// status for the given node.
212+
// +optional
202213
Status ClBpfApplicationStateStatus `json:"status,omitempty"`
203214
}
204215

apis/v1alpha1/cluster_bpf_application_types.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type ClBpfApplicationProgram struct {
7777
// name is a required field and is the name of the function that is the entry
7878
// point for the eBPF program. name must not be an empty string, must not
7979
// exceed 64 characters in length, must start with alpha characters and must
80-
// only contain alphanumeric characters.
80+
// only contain alphanumeric characters and underscores.
8181
// +required
8282
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
8383
// +kubebuilder:validation:MinLength=1
@@ -293,7 +293,9 @@ type ClBpfApplicationSpec struct {
293293
// effecting. For this reason, modifying the list is currently not allowed.
294294
// +required
295295
// +kubebuilder:validation:MinItems:=1
296-
Programs []ClBpfApplicationProgram `json:"programs"`
296+
// +kubebuilder:validation:MaxItems=1023
297+
// +listType=atomic
298+
Programs []ClBpfApplicationProgram `json:"programs,omitempty"`
297299
}
298300

299301
// +genclient
@@ -316,11 +318,16 @@ type ClBpfApplicationSpec struct {
316318
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`
317319
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
318320
type ClusterBpfApplication struct {
319-
metav1.TypeMeta `json:",inline"`
321+
metav1.TypeMeta `json:",inline"`
322+
// metadata is the standard object's metadata.
323+
// +optional
320324
metav1.ObjectMeta `json:"metadata,omitempty"`
321325

322-
Spec ClBpfApplicationSpec `json:"spec,omitempty"`
323-
Status BpfAppStatus `json:"status,omitempty"`
326+
// spec defines the desired state of the BpfApplication.
327+
// +required
328+
Spec ClBpfApplicationSpec `json:"spec,omitempty"`
329+
// status reflects the observed state of the BpfApplication.
330+
Status BpfAppStatus `json:"status,omitempty"`
324331
}
325332

326333
// +kubebuilder:object:root=true

apis/v1alpha1/cluster_fentry_program_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type ClFentryProgramInfo struct {
3030
// the program, add an entry to links with mode set to Attach. To detach it,
3131
// remove the entry from links.
3232
// +optional
33+
// +listType=atomic
3334
// +kubebuilder:validation:MaxItems=1
3435
Links []ClFentryAttachInfo `json:"links,omitempty"`
3536
}

apis/v1alpha1/cluster_fexit_program_types.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ type ClFexitProgramInfo struct {
3131
// remove the entry from links.
3232
// +optional
3333
// +kubebuilder:validation:MaxItems=1
34+
// +listType=atomic
3435
Links []ClFexitAttachInfo `json:"links,omitempty"`
3536
}
3637

3738
type ClFexitLoadInfo struct {
3839
// function is a required field and specifies the name of the Linux kernel
3940
// function to attach the FExit program. function must not be an empty string,
40-
// must not exceed 64 characters in length, must start with alpha characters
41-
// and must only contain alphanumeric characters.
41+
// must be between 1 and 64 characters in length, must start with alpha
42+
// characters and must only contain alphanumeric characters and underscores.
43+
// The pattern ^[a-zA-Z][a-zA-Z0-9_]+. is enforced.
4244
// +required
4345
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
4446
// +kubebuilder:validation:MinLength=1

apis/v1alpha1/cluster_kprobe_program_types.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ type ClKprobeProgramInfo struct {
3131
// default, the eBPF program is triggered at the entry of the attachment point,
3232
// but the attachment point can be adjusted using an optional offset.
3333
// +optional
34+
// +kubebuilder:validation:MaxItems=1
35+
// +listType=atomic
3436
Links []ClKprobeAttachInfo `json:"links,omitempty"`
3537
}
3638

3739
type ClKprobeAttachInfo struct {
3840
// function is a required field and specifies the name of the Linux kernel
3941
// function to attach the KProbe program. function must not be an empty string,
40-
// must not exceed 64 characters in length, must start with alpha characters
41-
// and must only contain alphanumeric characters.
42+
// must be between 1 and 64 characters in length, must start with alpha
43+
// characters and must only contain alphanumeric characters and underscores.
44+
// The pattern ^[a-zA-Z][a-zA-Z0-9_]+. is enforced.
4245
// +required
4346
// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9_]+."
4447
// +kubebuilder:validation:MinLength=1

apis/v1alpha1/shared_types.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ type InterfaceDiscovery struct {
2727
// CAUTION: This has the potential to attach a given eBPF program to a large
2828
// number of interfaces. Use with caution.
2929
// +optional
30-
// +kubebuilder:default:=false
30+
// +kubebuilder:default:=Disabled
31+
// +kubebuilder:validation:Enum=Enabled;Disabled
3132
InterfaceAutoDiscovery *bool `json:"interfaceAutoDiscovery,omitempty"`
3233

3334
// excludeInterfaces is an optional field that contains a list of interface
@@ -53,6 +54,7 @@ type InterfaceDiscovery struct {
5354
}
5455

5556
// InterfaceSelector describes the set of interfaces to attach a program to.
57+
// Exactly one of interfacesDiscoveryConfig, interfaces, or primaryNodeInterface must be specified.
5658
// +kubebuilder:validation:MaxProperties=1
5759
// +kubebuilder:validation:MinProperties=1
5860
type InterfaceSelector struct {
@@ -229,6 +231,7 @@ const (
229231
)
230232

231233
// ByteCodeSelector defines the various ways to reference BPF bytecode objects.
234+
// Exactly one of image or path must be specified.
232235
// +kubebuilder:validation:MaxProperties=1
233236
// +kubebuilder:validation:MinProperties=1
234237
type ByteCodeSelector struct {
@@ -238,7 +241,8 @@ type ByteCodeSelector struct {
238241
Image *ByteCodeImage `json:"image,omitempty"`
239242

240243
// path is an optional field and used to specify a bytecode object file via
241-
// filepath on a Kubernetes node.
244+
// filepath on a Kubernetes node. The path must be a valid absolute path with no null bytes,
245+
// matching the pattern ^(/[^/\0]+)+/?$.
242246
// +optional
243247
// +kubebuilder:validation:Pattern=`^(/[^/\0]+)+/?$`
244248
Path *string `json:"path,omitempty"`

apis/v1alpha1/zz_generated.deepcopy.go

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

bundle/manifests/bpfman-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ metadata:
10121012
capabilities: Basic Install
10131013
categories: OpenShift Optional
10141014
containerImage: quay.io/bpfman/bpfman-operator:latest
1015-
createdAt: "2025-10-09T13:50:06Z"
1015+
createdAt: "2025-10-15T17:08:16Z"
10161016
description: The bpfman Operator is designed to manage eBPF programs for applications.
10171017
features.operators.openshift.io/cnf: "false"
10181018
features.operators.openshift.io/cni: "false"

0 commit comments

Comments
 (0)