Skip to content

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

Conversation

yevgeny-shnaidman
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 3, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2023
@netlify
Copy link

netlify bot commented Aug 3, 2023

Deploy Preview for kubernetes-sigs-kmm ready!

Name Link
🔨 Latest commit 7cb49f4
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kmm/deploys/64cb9bf7fd5ff60007d5457a
😎 Deploy Preview https://deploy-preview-502--kubernetes-sigs-kmm.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 3, 2023
@yevgeny-shnaidman
Copy link
Contributor Author

/test pull-kernel-module-management-unit-tests

Copy link
Contributor

@qbarrand qbarrand left a 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?


import "errors"

var ErrNotFound = errors.New("not found")
Copy link
Contributor

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.

Copy link
Contributor Author

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
@yevgeny-shnaidman yevgeny-shnaidman force-pushed the yevgeny/err-not-found-mld branch from 45d50d4 to 7cb49f4 Compare August 3, 2023 12:22
@yevgeny-shnaidman
Copy link
Contributor Author

Does the calling code need this change as of today or for an upcoming features?

for the upcoming module-nmc controller

@qbarrand
Copy link
Contributor

qbarrand commented Aug 3, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 3, 2023
@k8s-ci-robot k8s-ci-robot merged commit bb43458 into kubernetes-sigs:main Aug 3, 2023
qbarrand pushed a commit to qbarrand/kernel-module-management that referenced this pull request Nov 8, 2023
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants