-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Default value of force should be false for template delete operation #7731
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
Default value of force should be false for template delete operation #7731
Conversation
|
@blueorangutan package |
|
@harikrishna-patnala a [SF] 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 6434 |
Codecov Report
@@ Coverage Diff @@
## 4.18 #7731 +/- ##
===========================================
Coverage 13.02% 13.02%
- Complexity 9032 9222 +190
===========================================
Files 2720 2720
Lines 257080 262616 +5536
Branches 40088 42312 +2224
===========================================
+ Hits 33476 34211 +735
- Misses 219400 224114 +4714
- Partials 4204 4291 +87
... and 25 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
DaanHoogland
left a comment
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
|
@blueorangutan test |
|
@rohityadavcloud a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7025)
|
|
@harikrishna-patnala can you add some testing information to the description? |
|
@blueorangutan package |
|
@rohityadavcloud a [SF] 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 6455 |
|
@harikrishna-patnala can you have a look if it does make sense for the test_templates tests to now fail? |
|
yes @DaanHoogland it seems to be related. I'll fix the tests too |
|
this parameter was introduced in PR #1773 changing the default value to |
shwstppr
left a comment
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.
Code LGTM
|
a similar issue: |
kiranchavala
left a comment
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.
LGTM , tested manually with the api call
Also tested with project
Before the fix
2023-08-02 10:25:41,346 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (qtp1239807799-18:ctx-6c52ee9f ctx-71da430f ctx-dbb08cbb) (logid:2828153a) submit async job-113, details: AsyncJobVO: {id:113, userId: 2, accountId: 2, instanceType: Template, instanceId: 215, cmd: org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd, cmdInfo: {"apiKey":"LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q","signature":"YiZXnlLsEqPiSiiMrEBLTiSJAlo\u003d","response":"json","ctxUserId":"2","httpmethod":"GET","ctxStartEventId":"267","id":"44bb4d22-c43c-4ce5-a9c0-fcf61aeb1775","ctxDetails":"{\"interface com.cloud.template.VirtualMachineTemplate\":\"44bb4d22-c43c-4ce5-a9c0-fcf61aeb1775\"}","ctxAccountId":"2","uuid":"44bb4d22-c43c-4ce5-a9c0-fcf61aeb1775","cmdEventType":"TEMPLATE.DELETE"}, cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: null, initMsid: 32986556793923, completeMsid: null, lastUpdated: null, lastPolled: null, created: null, removed: null}
After the fix
2023-08-02 10:21:24,306 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-41:ctx-f860df56 job-73) (logid:1cb54178) Executing AsyncJobVO: {id:73, userId: 2, accountId: 2, instanceType: Template, instanceId: 205, cmd: org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd, cmdInfo: {"apiKey":"LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q","signature":"bdb7Zdkui9CZUoFAr7RMvEoIpm8\u003d","response":"json","ctxUserId":"2","httpmethod":"GET","ctxStartEventId":"161","id":"2bc0c528-55f8-4860-9b00-8f1b0f2acff8","ctxDetails":"{\"interface com.cloud.template.VirtualMachineTemplate\":\"2bc0c528-55f8-4860-9b00-8f1b0f2acff8\"}","ctxAccountId":"2","uuid":"2bc0c528-55f8-4860-9b00-8f1b0f2acff8","cmdEventType":"TEMPLATE.DELETE"}, cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: null, initMsid: 32988351955670, completeMsid: null, lastUpdated: null, lastPolled: null, created: null, removed: null}
2023-08-02 10:21:24,306 DEBUG [c.c.a.ApiServlet] (qtp1239807799-13:ctx-a0ba720f ctx-e324f833 ctx-89287e07) (logid:9ba795bc) ===END=== 10.0.3.251 -- GET apiKey=LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q&command=deleteTemplate&id=2bc0c528-55f8-4860-9b00-8f1b0f2acff8&response=json&signature=bdb7Zdkui9CZUoFAr7RMvEoIpm8%3D
2023-08-02 10:21:24,315 WARN [c.c.t.TemplateManagerImpl] (API-Job-Executor-41:ctx-f860df56 job-73 ctx-89c8cbb6) (logid:1cb54178) Unable to delete template with id: 205 because VM instances: [VM instance {"id":8,"instanceName":"i-2-8-VM","type":"User","uuid":"3dbd61ea-6608-4bf7-9144-ac510eec8358"}] are using it.
2023-08-02 10:21:24,320 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-41:ctx-f860df56 job-73) (logid:1cb54178) Complete async job-73, jobStatus: FAILED, resultCode: 431, result: org.apache.cloudstack.api.response.ExceptionResponse/null/{"uuidList":[],"errorcode":"431","errortext":"Unable to delete template with id: 205 because VM instances: [VM instance {"id":8,"instanceName":"i-2-8-VM","type":"User","uuid":"3dbd61ea-6608-4bf7-9144-ac510eec8358"}] are using it."
|
@rohityadavcloud @harikrishna-patnala @DaanHoogland @shwstppr @kiranchavala |
|
moved to 4.18.2.0 milestone |
rohityadavcloud
left a comment
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.
LGTM didn't test it
29ac938 to
7b3cc99
Compare
|
@blueorangutan package |
|
@harikrishna-patnala a [SF] 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 6907 |
|
@blueorangutan test |
|
@harikrishna-patnala a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7588)
|
|
@harikrishna-patnala any resolution on this? cc @shwstppr |
@shwstppr , I think we can merge this if we take @weizhouapache 's remark into account. What do you think? |
|
@DaanHoogland I'm okay to merge this. |
yes @DaanHoogland This can be merged cc @shwstppr |
|
@harikrishna-patnala |
|
@DaanHoogland I get that I'm breaking backward compatibility, in my opinion documenting this is not needed as we are not breaking anything that is correct or expected behaviour by someone. On the other hand I also dont know where exactly to document this if you can suggest that helps please. |
|
as @weizhouapache sugested, it should be in the release notes in the breaking changes section. humans may expect this , but tools like ansible and terraform will not. |
|
ah we have a breaking changes section, nice. Thanks @DaanHoogland I'll create one. |
…pache#7731) * default value of force should be false * Added force flag in tests (cherry picked from commit a9f3af8) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Description
Default value of force should be false for the template delete operation
Types of changes
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?