Skip to content
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: get pod by pv volumeHandle #801

Merged
merged 3 commits into from
Nov 24, 2023
Merged

fix: get pod by pv volumeHandle #801

merged 3 commits into from
Nov 24, 2023

Conversation

zwwhdls
Copy link
Member

@zwwhdls zwwhdls commented Nov 17, 2023

  1. get all pvc when multiple pvs has the same volumeHandle when list app pods
  2. requeue mount pod periodically to avoid leaking in both kubelet polling and apiserver watching

@zwwhdls zwwhdls requested a review from Hexilee November 17, 2023 07:47
@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2023

Codecov Report

Attention: 31 lines in your changes are missing coverage. Please review.

Comparison is base (8c640ff) 36.56% compared to head (5eb8ed3) 36.47%.
Report is 4 commits behind head on master.

Files Patch % Lines
pkg/controller/pod_controller.go 0.00% 20 Missing ⚠️
pkg/controller/reconciler.go 0.00% 8 Missing ⚠️
pkg/controller/pod_driver.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #801      +/-   ##
==========================================
- Coverage   36.56%   36.47%   -0.10%     
==========================================
  Files          36       36              
  Lines        4365     4376      +11     
==========================================
  Hits         1596     1596              
- Misses       2620     2631      +11     
  Partials      149      149              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -84,16 +84,18 @@ func (m *PodController) Reconcile(ctx context.Context, request reconcile.Request
continue
}
if uniqueId != "" && (p.Spec.CSI.VolumeHandle == uniqueId || p.Spec.StorageClassName == uniqueId) {
pv = &p
break
relatedPVs = append(relatedPVs, &p)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should throw a warning when the same VolumeHandle is used by multiple PVs.

@zwwhdls zwwhdls merged commit e6d6413 into master Nov 24, 2023
23 checks passed
@zwwhdls zwwhdls deleted the fix/watch-apiserver branch November 24, 2023 08:07
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.

3 participants