-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support dedicating backup offerings to domains #12194
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12194 +/- ##
============================================
+ Coverage 17.57% 17.70% +0.13%
- Complexity 15550 15933 +383
============================================
Files 5913 5918 +5
Lines 529427 541258 +11831
Branches 64677 69524 +4847
============================================
+ Hits 93024 95808 +2784
- Misses 425940 434754 +8814
- Partials 10463 10696 +233
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@Pearl1594 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]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15952 |
|
@blueorangutan test |
|
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-14922) |
|
@blueorangutan package |
|
@Pearl1594 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]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15976 |
|
@blueorangutan test |
|
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-14958) |
|
[SF] Trillian test result (tid-14963)
|
|
@blueorangutan test |
|
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14972)
|
abh1sar
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.
Great job with the DomainAndZoneIdResolver. Some minor comments.
| @Override | ||
| public void execute() { | ||
| try { | ||
| if (StringUtils.isAllEmpty(getName(), getDescription()) && getAllowUserDrivenBackups() == null) { |
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.
We should add getDomainIds() to the if condition otherwise update will fail if only the domainIds parameter is getting changed.
| throw new CloudRuntimeException("A backup offering with the same name already exists in this zone"); | ||
| } | ||
|
|
||
| if (org.apache.commons.collections.CollectionUtils.isNotEmpty(cmd.getDomainIds())) { |
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.
Not really related to this change, but can we put org.apache.commons.collections.CollectionUtils in the imports?
line 1162 is using CollectionUtils from com.amazonaws.util which can be changed to use org.apache.commons.collections.CollectionUtils
| List<Long> filteredDomainIds = filterChildSubDomains(domainIds); | ||
| Collections.sort(filteredDomainIds); | ||
|
|
||
| boolean success =backupOfferingDao.update(id, offering); |
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.
| boolean success =backupOfferingDao.update(id, offering); | |
| boolean success = backupOfferingDao.update(id, offering); |
| final Domain validDomain = base._entityMgr.findByUuid(Domain.class, trimmed); | ||
| if (validDomain == null) { | ||
| logger.warn("Invalid domain specified for {}: {}", type, trimmed); | ||
| throw new InvalidParameterValueException("Failed to create " + type + " because invalid domain has been specified."); |
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.
Does it make sense to add the invalid domainId in the exception?
| return savedOffering; | ||
| } | ||
|
|
||
| private List<Long> filterChildSubDomains(final List<Long> domainIds) { |
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.
| if(!filteredDomainIds.equals(existingDomainIds)) { | ||
| SearchBuilder<BackupOfferingDetailsVO> sb = backupOfferingDetailsDao.createSearchBuilder(); | ||
| sb.and("offeringId", sb.entity().getResourceId(), SearchCriteria.Op.EQ); | ||
| sb.and("detailName", sb.entity().getName(), SearchCriteria.Op.EQ); | ||
| sb.done(); | ||
| SearchCriteria<BackupOfferingDetailsVO> sc = sb.create(); | ||
| sc.setParameters("offeringId", String.valueOf(id)); | ||
| sc.setParameters("detailName", ApiConstants.DOMAIN_ID); |
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.
Probably it would be better to move this to BackupOfferingDetailsDaoImpl?
| public List<Long> getBackupOfferingDomains(Long offeringId) { | ||
| final BackupOffering backupOffering = backupOfferingDao.findById(offeringId); | ||
| if (backupOffering == null) { | ||
| throw new InvalidParameterValueException("Unable to find backup offering " + backupOffering); |
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.
error message is accessing backupOffering which is null
| dataView: true, | ||
| popup: true, | ||
| groupMap: (selection) => { return selection.map(x => { return { id: x } }) }, | ||
| args: ['name', 'description', 'allowuserdrivenbackups'] |
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.
Is there a plan to add domainIds to updateBackupOffering UI?
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.
for what ever reason, domain update isn't support on UI for any of the offering types, so I chose to omit it as well.
| private String domainId; | ||
|
|
||
| @SerializedName(ApiConstants.DOMAIN) | ||
| @Param(description = "the domain name(s) this disk offering belongs to. Ignore this information as it is not currently applicable.") |
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.
Fix the description. Also since = "4.23.0" can be added
|
|
||
|
|
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.
extra lines can be removed
67721ad to
57332b0
Compare
57332b0 to
f7b99a4
Compare
|
@blueorangutan package |
|
@Pearl1594 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]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16062 |
abh1sar
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.
some nitpicks.
but overall CLGTM from me.
|
|
||
| @SerializedName(ApiConstants.DOMAIN_ID) | ||
| @Param(description = "the domain ID(s) this disk offering belongs to. Ignore this information as it is not currently applicable.") | ||
| @Param(description = "the domain ID(s) this disk offering belongs to. Ignore this information as it is not currently applicable.", |
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.
this disk offering -> this backup offering
"Ignore this information.." thus should not be here, right?
|
|
||
| @SerializedName(ApiConstants.DOMAIN) | ||
| @Param(description = "the domain name(s) this disk offering belongs to. Ignore this information as it is not currently applicable.") | ||
| @Param(description = "the domain name(s) this disk offering belongs to. Ignore this information as it is not currently applicable.", |
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.
Same here
|
|
||
| @DB | ||
| @Override | ||
| public void updateBackupOfferingDetails(long backupOfferingId, List<Long> filteredDomainIds) { |
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.
nit: rename to updateBackupOfferingDomainIdsDetails?
|
@blueorangutan test |
|
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-15008) |
|
|
@blueorangutan package |
|
@Pearl1594 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]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16077 |
|
@blueorangutan test |
|
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15019)
|



Description
This PR allows dedicating backup offerings to domains to be consistent in behaviour with other offerings
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?