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
server,cks: check if vm is cks node during vm destroy #9057
base: 4.19
Are you sure you want to change the base?
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. |
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.
clgtm
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specify the Kubernetes cluster id/name in the msg passed to the response?
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.
will add
|
||
@Override | ||
public ControlledEntity findByUuid(String uuid) { | ||
return kubernetesClusterDao.findByUuid(uuid); | ||
} | ||
|
||
@Override | ||
public void checkVmCanBeDestroyed(UserVm userVm) { |
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.
can destroy allowed with force option?
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.
do you mean adding a new API param as there is no force param in destroyVirtualMachine?
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.
yes, with force param in destroy call.
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.
+1
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.
@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?
@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 |
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?