-
Notifications
You must be signed in to change notification settings - Fork 159
fix: volumeID is incorrent when project name contains alpha/beta/v1 #1303
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
Conversation
Welcome @hoozecn! |
Hi @hoozecn. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hoozecn The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test Awesome great find. I'll take a look. |
Can we use net/url to parse the url for real? That will save us the next oops-regexps-are-hard error. I think log along the lines of the following should be right? url =url.Parse(selfLink) If you don't want to make this change I'll do it. Thanks again for finding this! |
hmm, my pseudocode isn't quite right as the link looks like https://www.googleapis.com/compute/v1/projects/mattcary-gke-dev3/zones/us-central1-a/disks/pvc-6d2dd754-cd70-48c8-9944-ddfa40608585, so the "compute" needs to be removed as well. Let me back up. Other places assume the volume id is projects/PPP/zones/ZZZ/disks/NNN (or perhaps projects/PPP/region/RRR/disks/NNN). Maybe it's best to extract that rather than trying to fiddle around with the prefix. I need to audit where else this cleanSelfLink is used, it's possible it's overloaded. |
Hmm, after looking over the code, "cleanSelfLink" is just a really poor way to do what it's trying to do. Let me do a slightly larger refactor instead. |
@@ -3304,6 +3304,16 @@ func TestCleanSelfLink(t *testing.T) { | |||
in: "https://www.partnerapis.com/compute/alpha/projects/project/zones/zone/disks/disk", | |||
want: "projects/project/zones/zone/disks/disk", | |||
}, | |||
{ | |||
name: "project name contains keyword", |
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.
Can we specify the key word in the test name instead of using 1 and 2? :)
We can probably refer to the existing regex validation from the GCE side for this string? |
Sorry clicked close by mistake |
I think that #1304 is preferable to this---it has a better chance of fixing the next error we haven't thought of yet :-) It's still running through the integration tests, which confirm if my idea to parse very strictly is okay. |
cool. lgtm. closing this one. when would it could be applied to the gke? or is there a maual way to to patch the cluster that i already created? dont want to create another project frankly speaking
/ |
We should be able to start pushing this out next week, it will take a couple weeks to go out. We should be able to backport to all affected versions. I'll update the timing here (but please ping if I forget). |
What type of PR is this?
/kind bug
Which issue(s) this PR fixes:
Fixes #1302
Does this PR introduce a user-facing change: