Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpfman-agent: don't try to unload bpf program that isn't loaded #75

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

anfredette
Copy link
Contributor

Fixes: #74

Fixes: bpfman#74

Signed-off-by: Andre Fredette <afredette@redhat.com>
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 27.36%. Comparing base (c1b72a4) to head (3993e76).
Report is 3 commits behind head on main.

Files Patch % Lines
controllers/bpfman-agent/common.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
- Coverage   27.36%   27.36%   -0.01%     
==========================================
  Files          81       81              
  Lines        6975     6976       +1     
==========================================
  Hits         1909     1909              
- Misses       4880     4881       +1     
  Partials      186      186              
Flag Coverage Δ
unittests 27.36% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

r.Logger.Error(err, "Failed to unload Program")
return ctrl.Result{RequeueAfter: retryDurationAgent}, nil

if id != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that could be made to work, but I'm not sure why it was implemented the way it was. The way GetID is currently implemented, it tells you if it wasn't set at all and if it was set, whether there was an error. We don't handle all these cases in the code, but we should think about it. I'd like to be able to call ListBpfmanPrograms() to see if it's loaded, but you have to know the program type. That can be fixed, but it will take a little time. This is a quick fix that works. We can make it better in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

sure I just found it confusing to get invalid Id will error is nil that is why suggesting the above I am fine with what you have for now maybe worth a tracking issue so we won't forget about it
/LGTM

@anfredette anfredette merged commit a4a9292 into bpfman:main Jul 30, 2024
18 checks passed
msherif1234 pushed a commit to msherif1234/bpfman-operator that referenced this pull request Nov 15, 2024
interface names hook doesn't allow more than one function per intfs per dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bpfman agent crashes when trying to delete unloaded BpfApplication program
2 participants