test/e2e/karmadactl_test.go: test addons command
What type of PR is this?
/kind failing-test
What this PR does / why we need it:
Which issue(s) this PR fixes:
Part of #4544
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
~~Currently, I'm usingthe kubectl raw command to interact with the karmada-host control plane. However, I believe there might be a more effective approach for access pattern? Additionally, I'm encountering a potential issue related to using the raw command in a controlled end-to-end (e2e) test environment. In the test case should enable/disable karmada-descheduler addon, I'm receiving an error indicating that the karmada-descheduler deployment is not being read properly. The pod container is generating the following logs:~~
I0806 18:18:48.034515 1 leaderelection.go:367] lock is held by karmada-controller-manager-cdbbf75dd-psfwl_d1c31ae4-5d61-48de-8831-47e59a1c3d0f and has not yet expired
I0806 18:18:48.034531 1 leaderelection.go:255] failed to acquire lease karmada-system/karmada-controller-manager
I0806 18:18:52.028097 1 leaderelection.go:367] lock is held by karmada-controller-manager-cdbbf75dd-psfwl_d1c31ae4-5d61-48de-8831-47e59a1c3d0f and has not yet expired
I0806 18:18:52.028114 1 leaderelection.go:255] failed to acquire lease karmada-system/karmada-controller-manager
~~I’m unsure if it's expected behavior to receive addon information when the specified namespace either does not exist or does not contain the Karmada components. For instance, when using the karmadactl addons list --help command, the namespace argument is defined as follows:~~
-n, --namespace='karmada-system':
namespace where Karmada components are installed.
~~However, when I run the command with an invalid namespace, like so:~~
karmadactl addons list --karmada-kubeconfig $KUBECONFIG --namespace="invalid"
~~I receive the following output:~~
|-----------------------------|----------|
| ADDON NAME | STATUS |
|-----------------------------|----------|
| karmada-descheduler | disabled |
| karmada-metrics-adapter | disabled |
| karmada-scheduler-estimator | unknown |
| karmada-search | disabled |
|-----------------------------|----------|
~~Is this the expected behavior? If this turns out to be a valid issue, I'd be glad to file a bug report and submit a pull request to address it.~~
It is expected as answered by @zhzhuang-zju's comment https://github.com/karmada-io/karmada/pull/5313#issuecomment-2290860437
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 31.15%. Comparing base (
80037ce) to head (ba735f9). Report is 29 commits behind head on master.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #5313 +/- ##
==========================================
+ Coverage 30.94% 31.15% +0.20%
==========================================
Files 638 640 +2
Lines 44307 44417 +110
==========================================
+ Hits 13712 13836 +124
+ Misses 29604 29580 -24
- Partials 991 1001 +10
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 31.15% <ø> (+0.20%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Okay, I figured it out while working on this PR #5334! I think it is now ready for review -after CI tests finish- :)
/assign @zhzhuang-zju
Is this the expected behavior? If this turns out to be a valid issue, I'd be glad to file a bug report and submit a pull request to address it.
~~@mohamedawnallah Sorry, I'm not very familiar with this command. I'll get back to you as soon as I have a conclusion.~~
The karmadactl addons list command determines the status of addons by checking for corresponding addons in that namespace. In practice, karmada instances are not restricted to being installed in any specific namespace, so from this perspective, the output of command karmadactl addons list --karmada-kubeconfig $KUBECONFIG --namespace="invalid" is as expected.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign xishanyongye-chang for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment