Skip to content

Ensure getCapacityState() is not called for hosts in maintenance#8025

Merged
DaanHoogland merged 1 commit intoapache:4.18from
leaseweb:capacity_maintenance
Oct 6, 2023
Merged

Ensure getCapacityState() is not called for hosts in maintenance#8025
DaanHoogland merged 1 commit intoapache:4.18from
leaseweb:capacity_maintenance

Conversation

@benj-n
Copy link
Copy Markdown
Contributor

@benj-n benj-n commented Sep 29, 2023

Description

This PR ensures getCapacityState() is not called for hosts in maintenance.
When a host is in maintenance, the relevant rows are removed from the op_host_capacity table. In this case, getCapacityState() triggers a nullpointer exception.

Fixes: #8024

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?

When a host is in maintenance, the relevant rows are removed from
the op_host_capacity table. In this case, getCapacityState() triggers
a nullpointer exception.
Copy link
Copy Markdown
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.

code looks good. I think some refactorring could make it more readable, like adding methods for the empty host and the actuall data adding.

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland 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.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7186

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 2, 2023

Codecov Report

Merging #8025 (df90875) into 4.18 (221f863) will increase coverage by 0.00%.
Report is 2 commits behind head on 4.18.
The diff coverage is 0.00%.

@@            Coverage Diff            @@
##               4.18    #8025   +/-   ##
=========================================
  Coverage     13.06%   13.07%           
- Complexity     9106     9107    +1     
=========================================
  Files          2720     2720           
  Lines        257506   257517   +11     
  Branches      40149    40152    +3     
=========================================
+ Hits          33649    33658    +9     
- Misses       219627   219628    +1     
- Partials       4230     4231    +1     
Files Coverage Δ
...che/cloudstack/metrics/PrometheusExporterImpl.java 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Copy Markdown
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

Code LGTM

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@DaanHoogland
Copy link
Copy Markdown
Contributor

@benj-n can you add test-information?

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Oct 4, 2023

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-7834)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 45765 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8025-t7834-kvm-centos7.zip
Smoke tests completed. 107 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_upgrade_kubernetes_cluster Failure 684.70 test_kubernetes_clusters.py

@DaanHoogland DaanHoogland merged commit a20ab40 into apache:4.18 Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants