-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add volume reconstruct/cleanup logic in kubelet volume manager #12024
Conversation
…nformation if global mount path is gone
@sttts @ingvagabund would you have time to review? |
This is basically backport from kubernetes, so it should be more like a formal review, right? |
Any chance to run more tests than the travis one? Hard to believe it is the only CI that is required to run. |
[test] |
you forgot to run |
Bunch of failures here appears to be because the test harness in jenkins doesn't work well for old builds anymore, such as:
|
We will need to set up a different job to handle non- |
@mfojtik I ran that. It doesn't produce any changes to generated code (or any commitable changes). Also locally when I ran |
@stevekuznetsov @mfojtik the PR for ose - https://github.com/openshift/ose/pull/480 |
@gnufied, thanks for taking care of this. Indeed, |
a4a8af2
to
d52c488
Compare
@@ -135,6 +135,18 @@ func (plugin *vsphereVolumePlugin) getCloudProvider() (*vsphere.VSphere, error) | |||
return vs, nil | |||
} | |||
|
|||
func (plugin *vsphereVolumePlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volume.Spec, error) { |
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.
should we pick up the latest fix
kubernetes/kubernetes#37167
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.
Lets keep that to a separate PR.
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.
that's for photon volume plugin, it's not present in OpenShift 1.3
Both changes are merged upstream (there's some funk in the links & description): lgtm for merge as soon as tests complete. |
@smarterclayton is this something we want to be updating the Origin 1.3 branch with? @jsafrane as I said before, our test infra is not set up to be able to run this test correctly. You won't see it pass here. This is why the OSE PR is created. |
@@ -37,6 +41,9 @@ type Interface interface { | |||
// IsLikelyNotMountPoint determines if a directory is a mountpoint. | |||
// It should return ErrNotExist when the directory does not exist. | |||
IsLikelyNotMountPoint(file string) (bool, error) | |||
// GetDeviceNameFromMount finds the device name by checking the mount path | |||
// to get the global mount path which matches its plugin directory | |||
GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) |
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.
also needs to pick up kubernetes/kubernetes#30724
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 PR won't hurt , but do we support OpenShift on non-Linux platforms?
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.
Origin is required to compile on all Linux platforms that have a build target (32, 64, arm64, and s390 eventually).
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.
Breaking the openshift dev experience on mac will earn a swift revert :)
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.
Basically must compile on all platforms, must not knowingly break kubelet on all Linux platforms.
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, picked kubernetes/kubernetes#30724
thanks for spotting that.
Was this back ported to 1.3? We've had another request to get at fixes in kube 1.3.x - it may be easier to simply merge those fixes via an update. |
kubernetes/kubernetes#27970 was backported to kubernetes-1.3 release branch. kubernetes/kubernetes#36840 is too new and hasn't been backported. |
glog.V(3).Infof("Orphaned pod %q found, but volumes are not cleaned up; err: %v", uid, err) | ||
continue | ||
} | ||
// Check whether volume is still mounted on disk. If so, do not delete directory | ||
if volumeNames, err := kl.getPodVolumeNameListFromDisk(uid); err != nil || len(volumeNames) != 0 { |
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.
@eparis @jsafrane so I reviewed this PR in some detail and this is the bit - which helps with volumes not getting deleted if it is still mounted on disk.
The other big change here is in reconciler.go:
- Refactor
reconcile()
function in its own function. There isn't code a code change in whole of reconcilation itself but diff looks pretty big because of refactoring. - After reconcillation - reconciler also periodically calls
reconstruct
- which populates state of world from pod by iterating through each pod volume plugin directory.
Overall, I think we should be okay.
this is critical bug. both changes were merged upstream already and this is just a pick of those changes. i reviewed and this lgtm. |
Removing merge, this does not compile on macs. |
You need to fix
in this PR before merge. |
@smarterclayton, it should be compilable now, I do not have mac though. |
[test] |
Evaluated for origin test up to feae665 |
I verified that this builds on OSX. |
[merge] |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11823/) (Base Commit: d200e8a) |
Evaluated for origin merge up to feae665 |
continuous-integration/openshift-jenkins/merge FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11847/) (Base Commit: d200e8a) |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1398417
There are two UPSTREAM fixes here, both are needed to fix the bug. Beware, the first one is HUGE :-(.