-
Notifications
You must be signed in to change notification settings - Fork 346
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
fix: add defence logic for PV without claime ref #796
fix: add defence logic for PV without claime ref #796
Conversation
|
Welcome @zezaeoh! |
Hi @zezaeoh. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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/test-infra repository. |
/ok-to-test |
Can you add some logs to the PR description to show that this error is triggered? |
ff760c9
to
84454df
Compare
Could you review again? :) |
/approve |
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.
Commits need to be squashed into one.
@@ -1283,6 +1283,9 @@ func (p *csiProvisioner) getSecretsFromSC(ctx context.Context, volume *v1.Persis | |||
} | |||
|
|||
// Resolve provision secret credentials. | |||
if volume.Spec.ClaimRef == nil { |
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 we dont have the secrets, dont we need to allow deletion? lets the CSI driver try to handle it
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.
Actually, action-runner-controller
deletes PV's ClaimRef intentionally to make PV orphan and reuse.
So, i think we should leave this PV as orphan
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.
Yes, that is for the ReclaimPolicy=Retained
PV right, not for the ReclaimPolicy=Delete
?
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.
Oh.. you are right! @Madhu-1
I'll follow your suggestion :) thx!!
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.
84454df
to
3441650
Compare
3441650
to
bb3185c
Compare
Could you review again? |
@zezaeoh changes look good, can you add also add some testing results to the description? For example, the logs showing that |
@zezaeoh do you know how it's possible that a volume for PV without |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, RaunakShah, zezaeoh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
What this PR does / why we need it:
App crashes when deleting PVs without ClaimRef.
When we use Custom Resource
RunnerSets
of action-runner-controller,That controller sets specific PV's ClaimRef to nil to release from PVC resource
https://github.com/actions-runner-controller/actions-runner-controller/blob/master/controllers/sync_volumes.go#L161-L176
In that case, this can lead to many PVs without a ClaimRef.
Which issue(s) this PR fixes:
Fixes #None
Special notes for your reviewer:
Does this PR introduce a user-facing change?: