-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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 issue in converting aws volume id from mount paths #36840
fix issue in converting aws volume id from mount paths #36840
Conversation
@@ -192,11 +192,11 @@ func (rc *reconciler) reconcile() { | |||
if rc.actualStateOfWorld.VolumeNodeExists( | |||
volumeToAttach.VolumeName, volumeToAttach.NodeName) { | |||
// Volume/Node exists, touch it to reset detachRequestedTime | |||
glog.V(1).Infof("Volume %q/Node %q is attached--touching.", volumeToAttach.VolumeName, volumeToAttach.NodeName) | |||
glog.V(5).Infof("Volume %q/Node %q is attached--touching.", volumeToAttach.VolumeName, volumeToAttach.NodeName) |
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.
Why lower the priority on these messages? Are they happening very frequently?
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, it prints out log for every reconciler loop
// aws://us-east-1/vol-1234 (../aws-ebs/mounts/aws/us-east-1/vol-1234) | ||
// vol-1234 (../aws-ebs/mounts/vol-1234) | ||
// This code is for dealing with the first two cases. | ||
if strings.HasPrefix(volumeID, "aws/") { |
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.
Having code to work around an AWS issue in common util/mount
is pretty bad. Is there any way this can be isolated to the aws ebs volume plugin?
} else { | ||
volumeID = strings.Replace(volumeID, "aws/", "aws:///", 1) | ||
} | ||
} |
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.
I wonder if we should put this only into the AWS provider?
9761157
to
5a64cd6
Compare
Jenkins Kubemark GCE e2e failed for commit 5a64cd6. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GKE smoke e2e failed for commit 5a64cd6. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GCE e2e failed for commit 5a64cd6. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE e2e failed for commit 5a64cd6. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE etcd3 e2e failed for commit 5a64cd6. Full PR test history. The magic incantation to run this job again is |
Jenkins GKE smoke e2e failed for commit 5a64cd6. Full PR test history. The magic incantation to run this job again is |
sourceName = strings.Replace(volumeID, "aws/", "aws:///", 1) | ||
} | ||
glog.V(4).Info("Convert aws volume name from %q to %q ", volumeID, sourceName) | ||
} |
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.
This looks right.
If I'm going to nit-pick, it might be safer to split the string, and then glog.Warning if it doesn't match one of the forms we expect.
i.e. we expect either aws/vol-12345678 or aws/us-east-1b/vol-12345678, but we should log if it doesn't look like that.
Bonus: code might be easier to understand also!
glog.Errorf("Failed to get volume id from mount %s - %v", mountPath, err) | ||
return "", err | ||
} | ||
return volumeID, 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.
I wonder if we should return a struct with the mount information. I see there's another overload which returns the ref count, so it's difficult to know exactly where this is used by pure grep. But this is my go-to trick (when in doubt, create a type!); not sure it's needed.
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, I plan to change the function name to avoid the confusion in another PR.
I think this looks right; I'll try to test on AWS this evening (once tests are green I guess). @jingxu97 any hints on how to trigger the code path? |
5a64cd6
to
6c66b6a
Compare
@k8s-bot verify test this |
6c66b6a
to
5349593
Compare
Jenkins verification failed for commit 5349593fb2ba20ea3662be1ee7f9683a7e10f6bb. Full PR test history. The magic incantation to run this job again is |
5349593
to
90b92ce
Compare
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.
One question, but otherwise LGTM
sourceName = awsURLNamePrefix + "" + "/" + volName // empty zone label | ||
} | ||
if length == 3 { | ||
sourceName = awsURLNamePrefix + "/" + names[1] + volName // names[1] is the zone label |
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.
Are we missing a '/' here? i.e. awsURLNamePrefix + "/" + names[1] + "/" + volName
?
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.
Fixed. Thanks for the review!
This PR is to fix the issue in converting aws volume id from mount paths. Currently there are three aws volume id formats supported. The following lists example of those three formats and their corresponding global mount paths: 1. aws:///vol-123456 (/var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-123456) 2. aws://us-east-1/vol-123456 (/var/lib/kubelet/plugins/kubernetes.io/mounts/aws/us-est-1/vol-123455) 3. vol-123456 (/var/lib/kubelet/plugins/kubernetes.io/mounts/aws/us-est-1/vol-123455) For the first two cases, we need to check the mount path and convert them back to the original format.
90b92ce
to
3d3e44e
Compare
@saad-ali : can you please reapply lgtm? looks like the bot did not pick up your last "/lgtm" |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
@jingxu97 are you going to cherry-pick this to 1.4 or have you done so? Would be great... |
@jingxu97 Any information regarding when the next 1.4 release will be? |
I think it will be one week after thanksgiving.
…On Wed, Nov 23, 2016 at 3:52 AM, Raffaele Di Fazio ***@***.*** > wrote:
@jingxu97 <https://github.com/jingxu97> Any information regarding when
the next 1.4 release will be?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36840 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ASSNxf-XDNMztvULe9zuyVd8NDM_TqDuks5rBCj3gaJpZM4KzBhh>
.
--
- Jing
|
Any chance this can be pushed out? Currently those running 1.4 release don't unmount AWS volumes which is a tough scenario for operations. |
Yeah we'd love to see 1.4.7 with the fix pushed, we're fighting this issue on a production cluster ATM. |
Yes, the fix will definitely be available in release 1.4.7.
…On Thu, Dec 8, 2016 at 5:55 AM, Michiel Rook ***@***.***> wrote:
Yeah we'd love to see 1.4.7 with the fix pushed, we're fighting this issue
on a production cluster ATM.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36840 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ASSNxVFU7dLQFj01m_TYFOtR7e59kr7qks5rGAw9gaJpZM4KzBhh>
.
--
- Jing
|
Automatic merge from submit-queue fix issue in converting aws volume id from mount paths This PR is to fix the issue in converting aws volume id from mount paths. Currently there are three aws volume id formats supported. The following lists example of those three formats and their corresponding global mount paths: 1. aws:///vol-123456 (/var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-123456) 2. aws://us-east-1/vol-123456 (/var/lib/kubelet/plugins/kubernetes.io/mounts/aws/us-est-1/vol-123455) 3. vol-123456 (/var/lib/kubelet/plugins/kubernetes.io/mounts/aws/us-est-1/vol-123455) For the first two cases, we need to check the mount path and convert them back to the original format. This PR fixes kubernetes#36269
This PR is to fix the issue in converting aws volume id from mount
paths. Currently there are three aws volume id formats supported. The
following lists example of those three formats and their corresponding
global mount paths:
(/var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-123456)
(/var/lib/kubelet/plugins/kubernetes.io/mounts/aws/us-est-1/vol-123455)
(/var/lib/kubelet/plugins/kubernetes.io/mounts/aws/us-est-1/vol-123455)
For the first two cases, we need to check the mount path and convert
them back to the original format.
This PR fixes #36269
This change is