-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Detect status before enable/disable addon #4424
Conversation
Hi @fenglixa. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Can one of the admins verify this patch? |
@minikube-bot ok-to-test |
1 similar comment
@minikube-bot ok-to-test |
@minikube-bot OK to test |
Thanks for contribution, could you pleas add unit testint ? Maybe have a mock enabled addon and try to enable it |
Thanks @medyagh Did you mean following? I think I appended it already. : )
|
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 contribution, could you pleas add unit testint ? Maybe have a mock enabled addon and try to enable it
Thanks @medyagh Did you mean following? I think I appended it already. : )
> ~/Documents/GitHub/minikube >> minikube addons list |grep enable - addon-manager: enabled - dashboard: enabled - default-storageclass: enabled - storage-provisioner: enabled ~/Documents/GitHub/minikube>> minikube addons enable dashboard 💥 addon dashboard was already enabled.
I meant like for example for this logic in your code
if addonStatus && enable {
console.ErrStyle(console.Conflict, "addon %s was already enabled.", addon.GetAddon())
os.Exit(exit.Unavailable)
} else if !addonStatus && !enable {
console.ErrStyle(console.Conflict, "addon %s was already disabled.", addon.GetAddon())
os.Exit(exit.Unavailable)
}
you could put it in a func and then add a TestFunc for it.
that you could do unit testing for that func, here are some example unit tests in minikube. https://github.com/kubernetes/minikube/blob/master/cmd/minikube/cmd/config/util_test.go#L69
you could have a unit test that tries to disable an already disabled addon, and expects it to get err
and you would write a unit test for this func in TestIsAddonAlreadySet(....) please let me know if you have any other questions :) |
@minikube-bot OK to test |
@medyagh Thanks for your comments. I added unit test cases for the new added func. Please help check & review. BR |
should be case issue related to #4418 |
@minikube-bot OK to test |
/ok-to-test |
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 a lot for improvements you made, it looks a lot better just a few more changes.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fenglixa The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
Test failed is not related to my modification. /retest |
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 all the changes, please change this to Name(). I think after this change it will be good to go !
@fenglixa can you please squash the commit to one |
…nged GetAddonName to Name
@RA489 squashed done. Thanks |
@fenglixa Thanks! |
Seems it can not take effect when I provide /retest command. Could someone help trigger retest of integration? Thanks |
/retest |
Thanks @RA489. but seems it is also not take effect. |
@minikube-bot OK to test |
@minikube-bot okay to test |
@minikube-bot OK to test |
@fenglixa Thank you so much for patiently making all the required changes and sorry for the unrelated failing tests. Thank you for the contribution |
Fix Usability: check addon status before disable. #4417
UT Result PASS:

Build & Test PASS:
