Ensure PVCs are detached from VM only if VM spec does not have reference to them.#4003
Ensure PVCs are detached from VM only if VM spec does not have reference to them.#4003skogta wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: skogta The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
9fd7f98 to
a6f53f1
Compare
|
Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
|
Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
|
FAILED --- Jenkins Build #1365 |
|
SUCCESS --- Jenkins Build #1366 |
|
Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
|
Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
|
Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
|
FAILED --- Jenkins Build #1369 |
|
FAILED --- Jenkins Build #1368 |
|
FAILED --- Jenkins Build #1084 |
|
Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
|
Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
|
SUCCESS --- Jenkins Build #1087 |
|
SUCCESS --- Jenkins Build #1371 |
a6f53f1 to
f939aee
Compare
f939aee to
4a615a9
Compare
|
Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
4a615a9 to
6e6c8b3
Compare
|
@skogta: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
|
FAILED --- Jenkins Build #1157 |
|
SUCCESS --- Jenkins Build #1534 |
What this PR does / why we need it:
During VM import, there is a race condition where there may be a delay from VM operator in adding a volume to batch attach spec.
In the meantime, CSI might incorrectly interpret that as a detach request (since volume is not there in batchattach spec but is attached to the VM on VM inventory).
In order to fix this, before adding a volume to detach list, it is important that CSI also validates that the volume is not being referenced in the VM spec. If it is being referenced, then skip adding that volume to detach list.
If VM object is not found, then fail the reconciliation.
As discussed on private chat, we should ignore safety check if PVC VM object is not found k8s cluster.
Testing done:
WCP precheckn (in progress): https://jenkins-vcf-csifvt.devops.broadcom.net/job/wcp-instapp-e2e-pre-checkin/1534/
VKS precheckin (in progress): https://jenkins-vcf-csifvt.devops.broadcom.net/job/vks-instapp-e2e-pre-checkin/1157/
Successfully attached a PVC to a VM.
Sucessfully detached a PVC from a VM.
Removed PVC from batchattach spec while it was still there in VM spec. Observed that detach was denied: