Skip to content

Commit a7d8eea

Browse files
committed
Review comments from Andre
Signed-off-by: Andre Fredette <[email protected]>
1 parent 9be77a2 commit a7d8eea

20 files changed

+447
-462
lines changed

apis/v1alpha1/bpf_application_state_types.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,31 +83,33 @@ type BpfApplicationProgramState struct {
8383
}
8484

8585
type BpfApplicationStateStatus struct {
86-
// updateCount is the number of times the BpfApplicationState has been updated.
87-
// Set to 1 when the object is created, then it is incremented prior to each
88-
// update. This is used to verify that the API server has the updated object
89-
// prior to starting a new Reconcile operation.
86+
// UpdateCount tracks the number of times the BpfApplicationState object has
87+
// been updated. The bpfman agent initializes it to 1 when it creates the
88+
// object, and then increments it before each subsequent update. It serves
89+
// as a lightweight sequence number to verify that the API server is serving
90+
// the most recent version of the object before beginning a new Reconcile
91+
// operation.
9092
UpdateCount int64 `json:"updateCount"`
9193
// node is the name of the Kubernets node for this BpfApplicationState.
9294
Node string `json:"node"`
9395
// appLoadStatus reflects the status of loading the eBPF application on the
94-
// given node. Whether or not the eBPF program is attached to an attachment
95-
// point is tracked by the linkStatus field, which is under of each link of
96-
// each program.
96+
// given node.
9797
//
9898
// NotLoaded is a temporary state that is assigned when a
9999
// ClusterBpfApplicationState is created and the initial reconcile is being
100100
// processed.
101101
//
102-
// LoadSuccess is returned if all the programs have been loaded with no errors.
102+
// LoadSuccess is returned if all the programs have been loaded with no
103+
// errors.
103104
//
104-
// LoadError is returned if one or more programs encountered an error and were
105-
// not loaded.
105+
// LoadError is returned if one or more programs encountered an error and
106+
// were not loaded.
106107
//
107108
// NotSelected is returned if this application did not select to run on this
108109
// Kubernetes node.
109110
//
110-
// UnloadSuccess is returned when all the programs were successfully unloaded.
111+
// UnloadSuccess is returned when all the programs were successfully
112+
// unloaded.
111113
//
112114
// UnloadError is returned if one or more programs encountered an error when
113115
// being unloaded.

apis/v1alpha1/bpf_application_types.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ type BpfApplicationProgram struct {
3838
// +kubebuilder:validation:MaxLength=64
3939
Name string `json:"name"`
4040

41-
// type is a required field used to specify the type of the eBPF program. The
42-
// type dictates which eBPF attachment point to use. This is where the eBPF
43-
// program is executed.
41+
// type is a required field used to specify the type of the eBPF program.
4442
//
4543
// Allowed values are:
4644
// TC, TCX, UProbe, URetProbe, XDP
@@ -175,8 +173,8 @@ type BpfApplicationSpec struct {
175173
// +kubebuilder:resource:scope=Namespaced
176174

177175
// BpfApplication is the schema for the namespace scoped BPF Applications API.
178-
// Using this API allows applications to load one or more eBPF programs on a
179-
// Kubernetes cluster using bpfman to load the programs.
176+
// This API allows applications to use bpfman to load and attach one or more
177+
// eBPF programs on a Kubernetes cluster.
180178
//
181179
// The bpfApplication.status field reports the overall status of the
182180
// BpfApplication CRD. A given BpfApplication CRD can result in loading and

apis/v1alpha1/cluster_bpf_application_state_types.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,17 @@ type ClBpfApplicationProgramState struct {
134134
}
135135

136136
type ClBpfApplicationStateStatus struct {
137-
// updateCount is the number of times the ClusterBpfApplicationState has been
138-
// updated. Set to 1 when the object is created, then it is incremented prior
139-
// to each update. This is used to verify that the API server has the updated
140-
// object prior to starting a new Reconcile operation.
137+
// UpdateCount tracks the number of times the BpfApplicationState object has
138+
// been updated. The bpfman agent initializes it to 1 when it creates the
139+
// object, and then increments it before each subsequent update. It serves
140+
// as a lightweight sequence number to verify that the API server is serving
141+
// the most recent version of the object before beginning a new Reconcile
142+
// operation.
141143
UpdateCount int64 `json:"updateCount"`
142144
// node is the name of the Kubernetes node for this ClusterBpfApplicationState.
143145
Node string `json:"node"`
144146
// appLoadStatus reflects the status of loading the eBPF application on the
145-
// given node. Whether or not the eBPF program is attached to an attachment
146-
// point is tracked by the linkStatus field, which is under of each link of
147-
// each program.
147+
// given node.
148148
//
149149
// NotLoaded is a temporary state that is assigned when a
150150
// ClusterBpfApplicationState is created and the initial reconcile is being

apis/v1alpha1/cluster_bpf_application_types.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ type ClBpfApplicationProgram struct {
8484
// +kubebuilder:validation:MaxLength=64
8585
Name string `json:"name"`
8686

87-
// type is a required field used to specify the type of the eBPF program. The
88-
// type dictates which eBPF attachment point to use. This is where the eBPF
89-
// program is executed.
87+
// type is a required field used to specify the type of the eBPF program.
9088
//
9189
// Allowed values are:
9290
// FEntry, FExit, KProbe, KRetProbe, TC, TCX, TracePoint, UProbe, URetProbe,
@@ -305,8 +303,8 @@ type ClBpfApplicationSpec struct {
305303
// +kubebuilder:resource:scope=Cluster
306304

307305
// ClusterBpfApplication is the schema for the cluster scoped BPF Applications
308-
// API. Using this API allows applications to load one or more eBPF programs on
309-
// a Kubernetes cluster using bpfman to load the programs.
306+
// API. This API allows applications to use bpfman to load and attach one or
307+
// more eBPF programs on a Kubernetes cluster.
310308
//
311309
// The clusterBpfApplication.status field reports the overall status of the
312310
// ClusterBpfApplication CRD. A given ClusterBpfApplication CRD can result in

apis/v1alpha1/cluster_tc_program_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type ClTcAttachInfo struct {
8989
// program in the chain will be called. If a TC program returns Stolen, the
9090
// next TC program in the chain will NOT be called.
9191
// +optional
92-
// +kubebuilder:default:={OK,Pipe,DispatcherReturn}
92+
// +kubebuilder:default:={Pipe,DispatcherReturn}
9393
ProceedOn []TcProceedOnValue `json:"proceedOn,omitempty"`
9494
}
9595

apis/v1alpha1/cluster_uprobe_program_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ type ClUprobeAttachInfo struct {
6666

6767
// containers is an optional field that identifies the set of containers in
6868
// which to attach the UProbe or URetProbe program. If containers is not
69-
// specified, the eBPF program will be attached in the bpfman-agent container.
69+
// specified, the eBPF program will be attached in the bpfman container.
7070
// +optional
7171
Containers *ClContainerSelector `json:"containers,omitempty"`
7272
}

apis/v1alpha1/cluster_xdp_program_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ type ClXdpProgramInfo struct {
3030
// attached or detached.
3131
//
3232
// The attachment point for an XDP program is a network interface (or device).
33-
// The interface can be specified by name, or by setting the
34-
// primaryNodeInterface flag, which instructs bpfman to use the primary
35-
// interface of a Kubernetes node. Optionally, the XDP program can also be
36-
// installed into a set of network namespaces.
33+
// The interface can be specified by name, by allowing bpfman to discover each
34+
// interface, or by setting the primaryNodeInterface flag, which instructs
35+
// bpfman to use the primary interface of a Kubernetes node. Optionally, the
36+
// XDP program can also be installed into a set of network namespaces.
3737
// +optional
3838
Links []ClXdpAttachInfo `json:"links,omitempty"`
3939
}

apis/v1alpha1/shared_types.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import (
2222

2323
type InterfaceDiscovery struct {
2424
// interfaceAutoDiscovery is an optional field. When enabled, the agent
25-
// monitors the creation and deletion of interfaces and automatically attached
26-
// eBPF programs to the newly discovered interfaces in both directions.
25+
// monitors the creation and deletion of interfaces and automatically
26+
// attached eBPF programs to the newly discovered interfaces.
2727
// CAUTION: This has the potential to attach a given eBPF program to a large
2828
// number of interfaces. Use with caution.
2929
// +optional
@@ -52,7 +52,7 @@ type InterfaceDiscovery struct {
5252
AllowedInterfaces []string `json:"allowedInterfaces,omitempty"`
5353
}
5454

55-
// InterfaceSelector defines how to attach to interfaces.
55+
// InterfaceSelector describes the set of interfaces to attach a program to.
5656
// +kubebuilder:validation:MaxProperties=1
5757
// +kubebuilder:validation:MinProperties=1
5858
type InterfaceSelector struct {
@@ -76,9 +76,10 @@ type InterfaceSelector struct {
7676
PrimaryNodeInterface *bool `json:"primaryNodeInterface,omitempty"`
7777
}
7878

79+
// ClContainerSelector identifies a set of containers.
7980
type ClContainerSelector struct {
8081
// namespace is an optional field and indicates the target Kubernetes
81-
// namespace. If not provided, the default Kubernetes namespace is used.
82+
// namespace. If not provided, all Kubernetes namespaces are included.
8283
// +optional
8384
Namespace string `json:"namespace,omitempty"`
8485

@@ -88,15 +89,15 @@ type ClContainerSelector struct {
8889
Pods metav1.LabelSelector `json:"pods"`
8990

9091
// containerNames is an optional field and is a list of container names in a
91-
// pod to attach the eBPF program. If no names are specified, all containers
92+
// pod to attach the eBPF program. If no names are specified, all containers
9293
// in the pod are selected.
9394
// +optional
9495
ContainerNames []string `json:"containerNames,omitempty"`
9596
}
9697

97-
// ContainerSelector identifies a set of containers. It is different from ContainerSelector
98+
// ContainerSelector identifies a set of containers. It is different from ClContainerSelector
9899
// in that "Namespace" was removed. Namespace scoped programs can only attach to the namespace
99-
// they are created in, so namespace at this level doesn't apply.
100+
// they are created in.
100101
type ContainerSelector struct {
101102
// pods is a required field and indicates the target pods. To select all pods
102103
// use the standard metav1.LabelSelector semantics and make it empty.
@@ -264,8 +265,8 @@ type ByteCodeImage struct {
264265
// When set to IfNotPresent, the given image will only be pulled if it is not
265266
// present on the node.
266267
//
267-
// When set to Never, the given image will never be pulled and must be load on
268-
// the node by some other means.
268+
// When set to Never, the given image will never be pulled and must be
269+
// loaded on the node by some other means.
269270
// +optional
270271
// +kubebuilder:default:=IfNotPresent
271272
ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty"`

apis/v1alpha1/uprobe_program_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ type UprobeAttachInfo struct {
6666

6767
// containers is an optional field that identifies the set of containers in
6868
// which to attach the UProbe or URetProbe program. If containers is not
69-
// specified, the eBPF program will be attached in the bpfman-agent container.
69+
// specified, the eBPF program will be attached in the bpfman container.
7070
// uprobe.
7171
Containers ContainerSelector `json:"containers"`
7272
}

bundle/manifests/bpfman-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ metadata:
998998
capabilities: Basic Install
999999
categories: OpenShift Optional
10001000
containerImage: quay.io/bpfman/bpfman-operator:latest
1001-
createdAt: "2025-04-11T14:23:21Z"
1001+
createdAt: "2025-04-30T20:54:07Z"
10021002
description: The bpfman Operator is designed to manage eBPF programs for applications.
10031003
features.operators.openshift.io/cnf: "false"
10041004
features.operators.openshift.io/cni: "false"

bundle/manifests/bpfman.io_bpfapplications.yaml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ spec:
2929
openAPIV3Schema:
3030
description: |-
3131
BpfApplication is the schema for the namespace scoped BPF Applications API.
32-
Using this API allows applications to load one or more eBPF programs on a
33-
Kubernetes cluster using bpfman to load the programs.
32+
This API allows applications to use bpfman to load and attach one or more
33+
eBPF programs on a Kubernetes cluster.
3434
3535
3636
The bpfApplication.status field reports the overall status of the
@@ -94,8 +94,8 @@ spec:
9494
present on the node.
9595
9696
97-
When set to Never, the given image will never be pulled and must be load on
98-
the node by some other means.
97+
When set to Never, the given image will never be pulled and must be
98+
loaded on the node by some other means.
9999
enum:
100100
- Always
101101
- Never
@@ -381,8 +381,8 @@ spec:
381381
default: false
382382
description: |-
383383
interfaceAutoDiscovery is an optional field. When enabled, the agent
384-
monitors the creation and deletion of interfaces and automatically attached
385-
eBPF programs to the newly discovered interfaces in both directions.
384+
monitors the creation and deletion of interfaces and automatically
385+
attached eBPF programs to the newly discovered interfaces.
386386
CAUTION: This has the potential to attach a given eBPF program to a large
387387
number of interfaces. Use with caution.
388388
type: boolean
@@ -605,8 +605,8 @@ spec:
605605
default: false
606606
description: |-
607607
interfaceAutoDiscovery is an optional field. When enabled, the agent
608-
monitors the creation and deletion of interfaces and automatically attached
609-
eBPF programs to the newly discovered interfaces in both directions.
608+
monitors the creation and deletion of interfaces and automatically
609+
attached eBPF programs to the newly discovered interfaces.
610610
CAUTION: This has the potential to attach a given eBPF program to a large
611611
number of interfaces. Use with caution.
612612
type: boolean
@@ -697,9 +697,7 @@ spec:
697697
type: object
698698
type:
699699
description: |-
700-
type is a required field used to specify the type of the eBPF program. The
701-
type dictates which eBPF attachment point to use. This is where the eBPF
702-
program is executed.
700+
type is a required field used to specify the type of the eBPF program.
703701
704702
705703
Allowed values are:
@@ -778,7 +776,7 @@ spec:
778776
description: |-
779777
containers is an optional field that identifies the set of containers in
780778
which to attach the UProbe or URetProbe program. If containers is not
781-
specified, the eBPF program will be attached in the bpfman-agent container.
779+
specified, the eBPF program will be attached in the bpfman container.
782780
uprobe.
783781
properties:
784782
containerNames:
@@ -912,7 +910,7 @@ spec:
912910
description: |-
913911
containers is an optional field that identifies the set of containers in
914912
which to attach the UProbe or URetProbe program. If containers is not
915-
specified, the eBPF program will be attached in the bpfman-agent container.
913+
specified, the eBPF program will be attached in the bpfman container.
916914
uprobe.
917915
properties:
918916
containerNames:
@@ -1092,8 +1090,8 @@ spec:
10921090
default: false
10931091
description: |-
10941092
interfaceAutoDiscovery is an optional field. When enabled, the agent
1095-
monitors the creation and deletion of interfaces and automatically attached
1096-
eBPF programs to the newly discovered interfaces in both directions.
1093+
monitors the creation and deletion of interfaces and automatically
1094+
attached eBPF programs to the newly discovered interfaces.
10971095
CAUTION: This has the potential to attach a given eBPF program to a large
10981096
number of interfaces. Use with caution.
10991097
type: boolean

bundle/manifests/bpfman.io_bpfapplicationstates.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,28 +60,28 @@ spec:
6060
appLoadStatus:
6161
description: |-
6262
appLoadStatus reflects the status of loading the eBPF application on the
63-
given node. Whether or not the eBPF program is attached to an attachment
64-
point is tracked by the linkStatus field, which is under of each link of
65-
each program.
63+
given node.
6664
6765
6866
NotLoaded is a temporary state that is assigned when a
6967
ClusterBpfApplicationState is created and the initial reconcile is being
7068
processed.
7169
7270
73-
LoadSuccess is returned if all the programs have been loaded with no errors.
71+
LoadSuccess is returned if all the programs have been loaded with no
72+
errors.
7473
7574
76-
LoadError is returned if one or more programs encountered an error and were
77-
not loaded.
75+
LoadError is returned if one or more programs encountered an error and
76+
were not loaded.
7877
7978
8079
NotSelected is returned if this application did not select to run on this
8180
Kubernetes node.
8281
8382
84-
UnloadSuccess is returned when all the programs were successfully unloaded.
83+
UnloadSuccess is returned when all the programs were successfully
84+
unloaded.
8585
8686
8787
UnloadError is returned if one or more programs encountered an error when
@@ -634,10 +634,12 @@ spec:
634634
type: array
635635
updateCount:
636636
description: |-
637-
updateCount is the number of times the BpfApplicationState has been updated.
638-
Set to 1 when the object is created, then it is incremented prior to each
639-
update. This is used to verify that the API server has the updated object
640-
prior to starting a new Reconcile operation.
637+
UpdateCount tracks the number of times the BpfApplicationState object has
638+
been updated. The bpfman agent initializes it to 1 when it creates the
639+
object, and then increments it before each subsequent update. It serves
640+
as a lightweight sequence number to verify that the API server is serving
641+
the most recent version of the object before beginning a new Reconcile
642+
operation.
641643
format: int64
642644
type: integer
643645
required:

0 commit comments

Comments
 (0)