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

kubelet: fix disk space check on btrfs (issue 47046) #47051

Closed

Conversation

flavio
Copy link

@flavio flavio commented Jun 6, 2017

What this PR does / why we need it:

This PR fixes the warning messages reported by kubelet when checking for the disk space on a btrfs / which has /var/lib/kubelet inside of a btrfs sub-volume.

This fix follows the same principle adopted to fix issue #38337 with commit dc8b6cc.

Which issue this PR fixes: fixes #47046

Special notes for your reviewer:

I'm going to submit the same fix also to cadvisor.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 6, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @flavio. 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 @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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. I understand the commands that are listed here.

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: flavio
We suggest the following additional approver: brendandburns

Assign the PR to them by writing /assign @brendandburns in a comment when ready.

Associated issue: 38337

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-label-needed labels Jun 6, 2017
major := major(buf.Dev)
minor := minor(buf.Dev)
for device, partition := range self.partitions {
if partition.major == major && partition.minor == minor {
return &DeviceInfo{device, major, minor}, nil
}
}

mount, ok := self.mounts[dir]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, I think ok should be found in this case.


mount, ok := self.mounts[dir]
if ok && mount.Fstype == "btrfs" && mount.Major == 0 && strings.HasPrefix(mount.Source, "/dev/") {
major, minor, ok := getBtrfsMajorMinorIds(mount)
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this should be major, minor, err

@brendandburns
Copy link
Contributor

@k8s-bot ok to test

This generally looks ok to me, but I'm not a storage expert. calling @kubernetes/sig-storage-pr-reviews

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 7, 2017
This commit fixes the warning messages reported by kubelet when
checking for the disk space on a btrfs `/` which has `/var/lib/kubelet`
inside of a btrfs sub-volume.

This fix follows the same principle adopted to fix issue kubernetes#38337 with
commit dc8b6cc.

This commit fixes issue 47046.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@flavio flavio force-pushed the kubelet-btrfs-snapshots-issue-47046 branch from 72605b8 to 0206d68 Compare June 7, 2017 07:21
@flavio
Copy link
Author

flavio commented Jun 7, 2017

@brendandburns: thanks for the feedback, I updated the code accordingly.

@k8s-ci-robot
Copy link
Contributor

@flavio: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-verify 0206d68 link @k8s-bot pull-kubernetes-verify test this
pull-kubernetes-e2e-gce-etcd3 0206d68 link @k8s-bot pull-kubernetes-e2e-gce-etcd3 test this

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@rootfs
Copy link
Contributor

rootfs commented Jun 7, 2017

@flavio wouldn't the fix first go to https://github.com/google/cadvisor/blob/master/fs/fs.go before vendoring in?

@flavio
Copy link
Author

flavio commented Jun 7, 2017

@flavio wouldn't the fix first go to https://github.com/google/cadvisor/blob/master/fs/fs.go before vendoring in?

I don't know what is the approach preferred by kubernetes. I just followed what was done with the previous fix about btrfs and kubelet.

I've already submitted the patch against cadvisor, but the patch had to be reworked a little because it didn't apply cleanly against master (they made some unrelated changes that are not available inside of the vendored version kubernetes has).

I'm open to revisit the approach I've taken.

@brendandburns
Copy link
Contributor

Oh, yes, sorry for not noticing that. This should be fixed in upstream and then vendored into k8s...

@brendandburns
Copy link
Contributor

I'm going to close this in favor of vendoring in the change.

Please see:

https://github.com/kubernetes/community/blob/master/contributors/devel/godep.md#using-godep

For instructions for updating a dependency.

Make sure that you go to the "Updating a dependency" section not the "adding a dependency" section.

And let me apologize in advance for the pain that is godep it's really unpleasant to deal with...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
6 participants