Skip to content

Commit 8e72399

Browse files
committed
WIP: Update to use the load/attach split from bpfman pr #1354
I'm still debugging, but wanted to push what I have so far. TODO: - get working on KIND - cleanup - update API per discussions and comments - update the TODO.md :-) Signed-off-by: Andre Fredette <[email protected]>
1 parent 6f89f1f commit 8e72399

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3162
-2375
lines changed

Containerfile.bpfman-agent

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Build the manager binary
22
ARG BUILDPLATFORM
33

4-
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.23 AS bpfman-agent-build
4+
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.24 AS bpfman-agent-build
55

66
# The following ARGs are set internally by docker/build-push-action in github actions
77
ARG TARGETOS
@@ -25,7 +25,7 @@ COPY . .
2525
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -mod vendor -o bpfman-agent ./cmd/bpfman-agent/main.go
2626

2727

28-
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.23 AS cri-tools-build
28+
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.24 AS cri-tools-build
2929
# The following ARGs are set internally by docker/build-push-action in github actions
3030
ARG TARGETOS
3131
ARG TARGETARCH

Containerfile.bpfman-operator

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Build the manager binary
22
ARG BUILDPLATFORM
33

4-
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.23 AS bpfman-operator-build
4+
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.24 AS bpfman-operator-build
55

66
ARG BUILDPLATFORM
77

apis/v1alpha1/kprobeProgram_types.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ type KprobeAttachInfo struct {
3737
// +kubebuilder:default:=0
3838
Offset uint64 `json:"offset"`
3939

40-
// Whether the program is a kretprobe. Default is false
40+
// Whether the program is a retprobe. Default is false
4141
// +optional
4242
// +kubebuilder:default:=false
43-
RetProbe bool `json:"retprobe"`
43+
Retprobe bool `json:"retprobe"`
4444
}
4545

4646
type KprobeProgramInfoState struct {
@@ -63,6 +63,8 @@ type KprobeAttachInfoState struct {
6363
// Not allowed for kretprobes.
6464
Offset uint64 `json:"offset"`
6565

66-
// Whether the program is a kretprobe.
67-
RetProbe bool `json:"retprobe"`
66+
// Whether the program is a retprobe. Default is false
67+
// +optional
68+
// +kubebuilder:default:=false
69+
Retprobe bool `json:"retprobe"`
6870
}

apis/v1alpha1/uprobeNsProgram_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ type UprobeNsAttachInfo struct {
3939
// Library name or the absolute path to a binary or library.
4040
Target string `json:"target"`
4141

42-
// Whether the program is a uretprobe. Default is false
42+
// Whether the program is a retprobe. Default is false
4343
// +optional
4444
// +kubebuilder:default:=false
45-
RetProbe bool `json:"retprobe"`
45+
Retprobe bool `json:"retprobe"`
4646

4747
// Only execute uprobe for given process identification number (PID). If PID
4848
// is not provided, uprobe executes for all PIDs.
@@ -79,10 +79,10 @@ type UprobeNsAttachInfoState struct {
7979
// Library name or the absolute path to a binary or library.
8080
Target string `json:"target"`
8181

82-
// Whether the program is a uretprobe. Default is false
82+
// Whether the program is a retprobe. Default is false
8383
// +optional
8484
// +kubebuilder:default:=false
85-
RetProbe bool `json:"retprobe"`
85+
Retprobe bool `json:"retprobe"`
8686

8787
// Only execute uprobe for given process identification number (PID). If PID
8888
// is not provided, uprobe executes for all PIDs.

apis/v1alpha1/uprobeProgram_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ type UprobeAttachInfo struct {
3939
// Library name or the absolute path to a binary or library.
4040
Target string `json:"target"`
4141

42-
// Whether the program is a uretprobe. Default is false
42+
// Whether the program is a retprobe. Default is false
4343
// +optional
4444
// +kubebuilder:default:=false
45-
RetProbe bool `json:"retprobe"`
45+
Retprobe bool `json:"retprobe"`
4646

4747
// Only execute uprobe for given process identification number (PID). If PID
4848
// is not provided, uprobe executes for all PIDs.
@@ -81,10 +81,10 @@ type UprobeAttachInfoState struct {
8181
// Library name or the absolute path to a binary or library.
8282
Target string `json:"target"`
8383

84-
// Whether the program is a uretprobe. Default is false
84+
// Whether the program is a retprobe. Default is false
8585
// +optional
8686
// +kubebuilder:default:=false
87-
RetProbe bool `json:"retprobe"`
87+
Retprobe bool `json:"retprobe"`
8888

8989
// Only execute uprobe for given process identification number (PID). If PID
9090
// is not provided, uprobe executes for all PIDs.

bundle/manifests/bpfman-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -21,73 +21,13 @@ metadata:
2121
},
2222
"nodeselector": {},
2323
"programs": [
24-
{
25-
"bpffunctionname": "kprobe_test",
26-
"kprobe": {
27-
"attach_points": [
28-
{
29-
"func_name": "try_to_wake_up",
30-
"offset": 0,
31-
"retprobe": false
32-
}
33-
]
34-
},
35-
"type": "Kprobe"
36-
},
37-
{
38-
"bpffunctionname": "kretprobe_test",
39-
"kprobe": {
40-
"attach_points": [
41-
{
42-
"func_name": "try_to_wake_up",
43-
"offset": 0,
44-
"retprobe": true
45-
}
46-
]
47-
},
48-
"type": "Kprobe"
49-
},
50-
{
51-
"bpffunctionname": "tracepoint_test",
52-
"tracepoint": {
53-
"attach_points": [
54-
{
55-
"name": "syscalls/sys_enter_openat"
56-
}
57-
]
58-
},
59-
"type": "Tracepoint"
60-
},
61-
{
62-
"bpffunctionname": "tc_pass_test",
63-
"tc": {
64-
"attach_points": [
65-
{
66-
"direction": "ingress",
67-
"interfaceselector": {
68-
"primarynodeinterface": true
69-
},
70-
"priority": 55
71-
}
72-
]
73-
},
74-
"type": "TC"
75-
},
7624
{
7725
"bpffunctionname": "tcx_next_test",
7826
"tcx": {
7927
"attach_points": [
80-
{
81-
"direction": "ingress",
82-
"interfaceselector": {
83-
"primarynodeinterface": true
84-
},
85-
"priority": 500
86-
},
8728
{
8829
"containers": {
8930
"containernames": [
90-
"bpfman",
9131
"bpfman-agent"
9232
],
9333
"namespace": "bpfman",
@@ -108,106 +48,6 @@ metadata:
10848
]
10949
},
11050
"type": "TCX"
111-
},
112-
{
113-
"bpffunctionname": "uprobe_test",
114-
"type": "Uprobe",
115-
"uprobe": {
116-
"attach_points": [
117-
{
118-
"containers": {
119-
"containernames": [
120-
"bpfman",
121-
"bpfman-agent"
122-
],
123-
"namespace": "bpfman",
124-
"pods": {
125-
"matchLabels": {
126-
"name": "bpfman-daemon"
127-
}
128-
}
129-
},
130-
"func_name": "malloc",
131-
"retprobe": false,
132-
"target": "libc"
133-
}
134-
]
135-
}
136-
},
137-
{
138-
"bpffunctionname": "uretprobe_test",
139-
"type": "Uprobe",
140-
"uprobe": {
141-
"attach_points": [
142-
{
143-
"containers": {
144-
"containernames": [
145-
"bpfman",
146-
"bpfman-agent"
147-
],
148-
"namespace": "bpfman",
149-
"pods": {
150-
"matchLabels": {
151-
"name": "bpfman-daemon"
152-
}
153-
}
154-
},
155-
"func_name": "malloc",
156-
"retprobe": true,
157-
"target": "libc"
158-
}
159-
]
160-
}
161-
},
162-
{
163-
"bpffunctionname": "xdp_pass_test",
164-
"type": "XDP",
165-
"xdp": {
166-
"attach_points": [
167-
{
168-
"interfaceselector": {
169-
"primarynodeinterface": true
170-
},
171-
"priority": 55
172-
},
173-
{
174-
"containers": {
175-
"containernames": [
176-
"bpfman",
177-
"bpfman-agent"
178-
],
179-
"namespace": "bpfman",
180-
"pods": {
181-
"matchLabels": {
182-
"name": "bpfman-daemon"
183-
}
184-
}
185-
},
186-
"interfaceselector": {
187-
"interfaces": [
188-
"eth0"
189-
]
190-
},
191-
"priority": 100
192-
}
193-
]
194-
}
195-
},
196-
{
197-
"bpffunctionname": "fentry_test",
198-
"fentry": {
199-
"attach": true,
200-
"function_name": "do_unlinkat"
201-
},
202-
"type": "Fentry"
203-
},
204-
{
205-
"bpffunctionname": "fexit_test",
206-
"fexit": {
207-
"attach": true,
208-
"function_name": "do_unlinkat"
209-
},
210-
"type": "Fexit"
21151
}
21252
]
21353
}
@@ -348,7 +188,7 @@ metadata:
348188
capabilities: Basic Install
349189
categories: OpenShift Optional
350190
containerImage: quay.io/bpfman/bpfman-operator:latest
351-
createdAt: "2025-02-25T13:35:37Z"
191+
createdAt: "2025-02-25T23:14:53Z"
352192
description: The bpfman Operator is designed to manage eBPF programs for applications.
353193
features.operators.openshift.io/cnf: "false"
354194
features.operators.openshift.io/cni: "false"

bundle/manifests/bpfman.io_bpfapplications.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ spec:
269269
type: integer
270270
retprobe:
271271
default: false
272-
description: Whether the program is a kretprobe. Default
272+
description: Whether the program is a retprobe. Default
273273
is false
274274
type: boolean
275275
required:
@@ -673,7 +673,7 @@ spec:
673673
type: integer
674674
retprobe:
675675
default: false
676-
description: Whether the program is a uretprobe. Default
676+
description: Whether the program is a retprobe. Default
677677
is false
678678
type: boolean
679679
target:

bundle/manifests/bpfman.io_bpfapplicationstates.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ spec:
183183
format: int64
184184
type: integer
185185
retprobe:
186-
description: Whether the program is a kretprobe.
186+
default: false
187+
description: Whether the program is a retprobe. Default
188+
is false
187189
type: boolean
188190
should_attach:
189191
description: ShouldAttach reflects whether the attachment
@@ -197,7 +199,6 @@ spec:
197199
- attachpointstatus
198200
- func_name
199201
- offset
200-
- retprobe
201202
- should_attach
202203
- uuid
203204
type: object
@@ -481,7 +482,7 @@ spec:
481482
type: integer
482483
retprobe:
483484
default: false
484-
description: Whether the program is a uretprobe. Default
485+
description: Whether the program is a retprobe. Default
485486
is false
486487
type: boolean
487488
should_attach:

bundle/manifests/bpfman.io_bpfnsapplications.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ spec:
573573
type: integer
574574
retprobe:
575575
default: false
576-
description: Whether the program is a uretprobe. Default
576+
description: Whether the program is a retprobe. Default
577577
is false
578578
type: boolean
579579
target:

bundle/manifests/bpfman.io_bpfnsapplicationstates.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ spec:
301301
type: integer
302302
retprobe:
303303
default: false
304-
description: Whether the program is a uretprobe. Default
304+
description: Whether the program is a retprobe. Default
305305
is false
306306
type: boolean
307307
should_attach:

0 commit comments

Comments
 (0)