Skip to content

Conversation

tklauser
Copy link
Member

@tklauser tklauser commented Mar 20, 2025

Stub out metrics.enableIfIndexMetrics on all non-Linux platforms to cut the dependency on pkg/datapath and transitively on github.com/cilium/ebpf. Without this change the build fails e.g. for GOOS=darwin in the case of cilium-cli when updating cilium/ebpf beyond v0.17.1.

With the above fixed, revert the cilium/ebpf downgrade to v0.17.3, see #38334.

Also remove the unused Errno2Outcome helper function.

Fixes #37598


The dependency graph was generated using the following command:

godepgraph ./cilium-cli/cmd/cilium | dot -Tpng -o cilium-cli-godepgraph.png

The resulting image is attached.

It's unused since commit cc676c7 ("bpf: replace BPF_MAP_UPDATE_ELEM
syscall with ebpf-go").

Signed-off-by: Tobias Klauser <tobias@cilium.io>
Otherwise we get build errors on darwin when updating cilium/ebpf beyond
v0.17.1.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
This reverts commit 03a2d94.

Reason for revert: the dependency on pkg/datapath and thus
github.com/cilium/ebpf on non-Linux platform was removed by successive
commits.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser added the release-note/misc This PR makes changes that have no direct user impact. label Mar 20, 2025
@tklauser tklauser requested review from a team as code owners March 20, 2025 12:01
@tklauser
Copy link
Member Author

/test

@tklauser tklauser enabled auto-merge March 20, 2025 12:06
Copy link
Contributor

@gentoo-root gentoo-root left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing it!

Copy link
Contributor

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tklauser Good work!

Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for figuring this out! I understand you used godepgraph in the end, is that right? Might be worth recording that in the PR description in case this comes up again.

@tklauser
Copy link
Member Author

Awesome, thanks for figuring this out! I understand you used godepgraph in the end, is that right? Might be worth recording that in the PR description in case this comes up again.

Good call. Added the godepgraph command I used and the resulting dependency graph image to the PR description.

@tklauser tklauser added this pull request to the merge queue Mar 21, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 21, 2025
Merged via the queue into main with commit 32ac969 Mar 21, 2025
310 of 311 checks passed
@tklauser tklauser deleted the pr/tklauser/cilium-cli-datapath-metrics branch March 21, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove dependency from cilium-cli onto pkg/datapath, cilium/ebpf library
6 participants