-
Notifications
You must be signed in to change notification settings - Fork 35
Adding NotFound error to the GetMLD API #502
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
Adding NotFound error to the GetMLD API #502
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yevgeny-shnaidman The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Deploy Preview for kubernetes-sigs-kmm ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
/test pull-kernel-module-management-unit-tests |
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.
Does the calling code need this change as of today or for an upcoming features?
internal/utils/errors.go
Outdated
|
||
import "errors" | ||
|
||
var ErrNotFound = errors.New("not found") |
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 would make this ErrNoMatchingKernelMapping
and move it to the internal/module
package where it is used.
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.
fixed
In case kernel mapping for the kernel version is not found, GetModuleLoaderDataForKernel API returns an indistinguishable error, just like in case there was some internal error during processing. This PR introducing a new propriaetory error: ErrNotFound. In case kernel mapping for a specific kernel does not exists, this error will be returned. As a consequence, the calling code will be able to act seperatly on internal error, or on KernelMapping not present, which may not be an error at all
45d50d4
to
7cb49f4
Compare
for the upcoming module-nmc controller |
/lgtm |
…etes-sigs#689) In case kernel mapping for the kernel version is not found, GetModuleLoaderDataForKernel API returns an indistinguishable error, just like in case there was some internal error during processing. This PR introducing a new propriaetory error: ErrNotFound. In case kernel mapping for a specific kernel does not exists, this error will be returned. As a consequence, the calling code will be able to act seperatly on internal error, or on KernelMapping not present, which may not be an error at all Upstream-Commit: bb43458 Co-authored-by: Yevgeny Shnaidman <[email protected]>
In case kernel mapping for the kernel version is not found, GetModuleLoaderDataForKernel API returns an indistinguishable error, just like in case there was some internal error during processing.
This PR introducing a new propriaetory error: ErrNotFound. In case kernel mapping for a specific kernel does not exists, this error will be returned. As a consequence, the calling code will be able to act seperatly on internal error, or on KernelMapping not present, which may not be an error at all