server,cks: check if vm is cks node during vm destroy#9057
server,cks: check if vm is cks node during vm destroy#9057DaanHoogland merged 6 commits intoapache:4.19from
Conversation
Fixes apache#8902 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #9057 +/- ##
============================================
- Coverage 14.96% 14.96% -0.01%
+ Complexity 10995 10988 -7
============================================
Files 5373 5373
Lines 469005 469071 +66
Branches 58953 61186 +2233
============================================
- Hits 70198 70184 -14
- Misses 391036 391120 +84
+ Partials 7771 7767 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
@shwstppr would it be a valid use case for users to
for your information, in Autoscale VM group, users can destroy a specific VM when the vm group is disabled. |
| return; | ||
| } | ||
| logger.error(String.format("VM ID: %s is a part of Kubernetes cluster ID: %d", userVm.getId(), vmMapVO.getClusterId())); | ||
| throw new CloudRuntimeException("Instance is a part of a Kubernetes cluster"); |
There was a problem hiding this comment.
specify the Kubernetes cluster id/name in the msg passed to the response?
| } | ||
|
|
||
| @Override | ||
| public void checkVmCanBeDestroyed(UserVm userVm) { |
There was a problem hiding this comment.
can destroy allowed with force option?
There was a problem hiding this comment.
do you mean adding a new API param as there is no force param in destroyVirtualMachine?
There was a problem hiding this comment.
yes, with force param in destroy call.
There was a problem hiding this comment.
@sureshanaparti @vishesh92 I'm not completely in favour of adding the parameter. Deleting specific node of a k8s cluster is already covered by scaleKubernetesCluster API
see #9057 (comment)
Do we have any other specific case for which we should allow the operation?
There was a problem hiding this comment.
No other specific use case from my side.
@weizhouapache understood. Though destroying a valid cks node is also allowed right now.
|
thanks @shwstppr |
|
@weizhouapache on the special case discussed earlier, @Pearl1594 made me aware that we already have an option with scaleKubernetesCluster API to delete a specific node using |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
That is great, thanks @shwstppr Overall this pr looks good to me. Can we add the information above in the error message, if user tries to delete a cks node? |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 9656 |
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9665 |
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9695 |
|
@blueorangutan test |
|
@shwstppr a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-10283)
|
|
Added test API calls in the PR description |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>


Description
Fixes: #8902
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?