Skip to content

Commit 4e2b3e7

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

20 files changed

+581
-600
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
}

0 commit comments

Comments
 (0)