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
Use the correct volum handle format for GCE regional PD. #99169
Use the correct volum handle format for GCE regional PD. #99169
Conversation
Welcome @TeweiLuo! |
Hi @TeweiLuo. Thanks for your PR. I'm waiting for a kubernetes 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 |
/sig storage |
@msau42 can you help to approve this? |
/assign @msau42 |
@@ -231,7 +231,7 @@ func (g *gcePersistentDiskCSITranslator) TranslateInTreePVToCSI(pv *v1.Persisten | |||
if err != nil { | |||
return nil, fmt.Errorf("failed to get region from zones: %v", err) | |||
} | |||
volID = fmt.Sprintf(volIDZonalFmt, UnspecifiedValue, region, pv.Spec.GCEPersistentDisk.PDName) | |||
volID = fmt.Sprintf(volIDRegionalFmt, UnspecifiedValue, region, pv.Spec.GCEPersistentDisk.PDName) |
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.
do we have a unit test for this?
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.
The only test we have that covers PV translation is
func TestTranslationStability(t *testing.T) { |
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.
Yeah I think a unit test to cover this case would be good
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.
Ack - will add a test case.
Update: since RePD migration is hard to test with OSS e2e infra, we'll test internally in GKE and then sync the status there. |
I think what Michelle means is we can add a unit test in https://github.com/kubernetes/kubernetes/blob/e16c6cc3483989899961c623518a1150e9078495/staging/src/k8s.io/csi-translation-lib/plugins/gce_pd_test.go to test if the volID being generated is correct when TranslateInTreePVToCSI |
2d741a1
to
419ea09
Compare
419ea09
to
068bdcf
Compare
/lgtm |
/lgtm Thanks! /milestone v1.21 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: msau42, TeweiLuo 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 |
/test pull-kubernetes-node-e2e |
…#99169-upstream-release-1.18 Automated cherry pick of #99169: Use the correct volum handle format for GCE regional PD.
…#99169-upstream-release-1.19 Automated cherry pick of #99169: Use the correct volum handle format for GCE regional PD.
…#99169-upstream-release-1.20 Automated cherry pick of #99169: Use the correct volum handle format for GCE regional PD.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fix bug in gcd_pd PV translation to make sure migration works for regional disks.
Which issue(s) this PR fixes:
Fixes #85623
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: