Skip to content

Commit b9dd6bc

Browse files
authored
Merge pull request #47 from akwi-github/add-metrics
minor fixes
2 parents 0d01efa + b4bcc62 commit b9dd6bc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,13 @@ func syncInterface(v4net, v6net, podIPNet *net.IPNet) error {
441441
return err
442442
}
443443

444+
if !metricsEnabled {
445+
// override, if !metricsEnabled then possibly bpffs not mounted and can't pin
446+
// by name
447+
spec.Maps["ip64_metrics"].Pinning = ebpf.PinNone
448+
spec.Maps["ip46_metrics"].Pinning = ebpf.PinNone
449+
}
450+
444451
for _, prog := range spec.Programs {
445452
klog.Infof("eBPF program spec section %s name %s", prog.SectionName, prog.Name)
446453
}

tests/e2e/e2e.bats

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@
170170

171171
kubectl wait --for=condition=ready pod/test-bpfmap1 --timeout=30s
172172
kubectl exec -i test-bpfmap1 -- sh -c "
173-
apt-get update > /dev/null
174173
ping -c 7 64:ff9b::$ip_address >&2
175174
"
176175
#gather metrics before the second ping
@@ -182,7 +181,6 @@
182181
--restart=Never \
183182
--command \
184183
-- sh -c "
185-
apt-get update >/dev/null 2>&1
186184
sleep 20
187185
get_icmp6_count() {
188186
curl --silent localhost:8881/metrics | grep protocol=\\\"ICMPv6\\\" | cut -d ' ' -f2
@@ -205,7 +203,6 @@
205203
--restart=Never \
206204
--command \
207205
-- sh -c "
208-
apt-get update >/dev/null 2>&1
209206
get_icmp6_count() {
210207
curl --silent localhost:8881/metrics | grep protocol=\\\"ICMPv6\\\" | cut -d ' ' -f2
211208
}

0 commit comments

Comments
 (0)