-
Notifications
You must be signed in to change notification settings - Fork 85
fix: Catches KeyError while enabling SRIOV addon #249
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
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.
Hello, I've left a few comments.
@@ -19,7 +19,7 @@ jobs: | |||
run: | | |||
sudo apt-get update | |||
sudo apt-get install -y python3-setuptools nfs-common | |||
sudo pip3 install --upgrade pip | |||
sudo pip3 install --ignore-installed --upgrade pip |
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.
out of curiosity, what kind of error does this fix?
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.
The one that currently causes the main
branch to fails: https://github.com/canonical/microk8s-community-addons/actions/runs/13940246715/job/39015602148
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.
Right, I've seen that error as well. It's probably because pip3
is installed through apt
, and upgrading it through pip3
won't work. I've opted to update the apt package 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 guess this fix doesn't belong to this PR anyway.
BTW, there's another issue in the main
killing the tests now.
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 you're referring to the previous run when it failed: https://github.com/canonical/microk8s-community-addons/actions/runs/14036415249/job/39295392373
Seems like there's no issue anymore.
Hi @claudiubelu |
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.
Thanks for the updates!
This PR fixes an issue with the first iteration of the SRIOV resources availability check.
Original implementation raises
KeyError
if the the resources are not available. As a resultwhile
is exiting immediately and has no effect.This simple fix catches the
KeyError
and allows the loop to continue as expected.Additionally, the PR fixes the
Run tests
workflow.Also verify you have: