-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
Fixes: bpfman#74 Signed-off-by: Andre Fredette <afredette@redhat.com>
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
r.Logger.Error(err, "Failed to unload Program") | ||
return ctrl.Result{RequeueAfter: retryDurationAgent}, nil | ||
|
||
if id != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about returning error here https://github.com/bpfman/bpfman-operator/blob/main/controllers/bpfman-agent/internal/bpfman-core.go#L213 instead ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
interface names hook doesn't allow more than one function per intfs per dir
Fixes: #74