Skip to content

API: Increase leniency to list templates on secondary stores that have been marked deleted by updating the db#4713

Merged
yadvr merged 1 commit intoapache:4.15from
shapeblue:defensive-check
Feb 24, 2021
Merged

API: Increase leniency to list templates on secondary stores that have been marked deleted by updating the db#4713
yadvr merged 1 commit intoapache:4.15from
shapeblue:defensive-check

Conversation

@Pearl1594
Copy link
Contributor

Description

This PR aims at restoring the previous level of leniency in listing templates on stores that have been marked as deleted / removed by updating the DB.
While Cloudstack doesn't allow deleting stores that have resources on them, it may so happen that users may mimic a deletion of a store by merely updating the DB. Under such a case, listing of templates is hampered due to an NPE that is caused. (as seen in #4606)

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Mark an image store having templates (public/private) on them as deleted by updating the DB i.e., setting the removed field to some timestamp
Try listing the templates, should list all templates as usual

@Pearl1594 Pearl1594 added this to the 4.15.1.0 milestone Feb 19, 2021
@Pearl1594 Pearl1594 changed the title API: Increase leniency to list templates on secondary stores that hae been marked deleted by updating the db API: Increase leniency to list templates on secondary stores that have been marked deleted by updating the db Feb 19, 2021
@shwstppr
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2799

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

Copy link
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, makes sense

@blueorangutan
Copy link

Trillian test result (tid-3602)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32462 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4713-t3602-kvm-centos7.zip
Smoke tests completed. 86 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@yadvr yadvr merged commit ccbcb08 into apache:4.15 Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants