Skip to content

fix(controller): fix nil pointer dereference in BDC controller due to non existent BD#479

Merged
kmova merged 1 commit intoopenebs-archive:masterfrom
akhilerm:fix-ndm-operator
Sep 3, 2020
Merged

fix(controller): fix nil pointer dereference in BDC controller due to non existent BD#479
kmova merged 1 commit intoopenebs-archive:masterfrom
akhilerm:fix-ndm-operator

Conversation

@akhilerm
Copy link
Copy Markdown
Contributor

Signed-off-by: Akhil Mohan akhil.mohan@mayadata.io

Why is this PR required? What issue does it fix?:
When a Claimed BD is manually deleted by removing the finalizer, and later when the user
tries to delete BDC, NDM operator will continuously crash. This because NDM operator
tries to release a non existent BD.

What this PR does?:
adds a check to throw an error when the claimed BD is not found. This PR also adds an event to BDC when BlockDevice is not found.

Does this PR require any upgrade changes?:
No

If the changes in this PR are manually verified, list down the scenarios covered::

Any additional information for your reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

@akhilerm akhilerm requested a review from kmova August 31, 2020 10:21
@akhilerm akhilerm changed the title fix(controller): fix nil pointer deference in BDC controller due to non existent BD fix(controller): fix nil pointer dereference in BDC controller due to non existent BD Aug 31, 2020
… non existent BD

when a Claimed BD is manually deleted by removing the finalizer, and later when the user
tries to delete BDC, NDM operator will continuously crash. This because NDM operator
tries to release a non existent BD. This change throws an error and add an event to BDC
when a corresponding BD cannot be found.

Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 31, 2020

Codecov Report

Merging #479 into master will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #479      +/-   ##
==========================================
- Coverage   40.40%   40.35%   -0.05%     
==========================================
  Files          72       72              
  Lines        3527     3531       +4     
==========================================
  Hits         1425     1425              
- Misses       1993     1997       +4     
  Partials      109      109              
Impacted Files Coverage Δ
...er/blockdeviceclaim/blockdeviceclaim_controller.go 39.24% <0.00%> (-0.87%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a859fe...a868d8e. Read the comment docs.

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.

panic in NDM operator: blockdeviceclaim.(*ReconcileBlockDeviceClaim).isDeviceRequestedByThisDeviceClaim(...)

5 participants