Skip to content

Add VolumeStats for Windows #627

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

Merged
merged 1 commit into from
Oct 10, 2020
Merged

Conversation

jingxu97
Copy link
Contributor

@jingxu97 jingxu97 commented Oct 9, 2020

add support for getting volume stats for windows. Tested on Windows node with following and it is working.
note: Inode is not available for windows.
invoke-webrequest http://localhost:10255/metrics -outfile metrics

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #628

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Oct 9, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jingxu97

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 9, 2020
@jingxu97
Copy link
Contributor Author

jingxu97 commented Oct 9, 2020

/retest

@jingxu97
Copy link
Contributor Author

jingxu97 commented Oct 9, 2020

cc @mattcary @verult

@jingxu97
Copy link
Contributor Author

jingxu97 commented Oct 9, 2020

/retest

zero := int64(0)
return zero, zero, zero, zero, zero, zero, fmt.Errorf("Not implemented")
//return zero, zero, zero, zero, zero, zero, fmt.Errorf("Not implemented")
Copy link
Contributor

Choose a reason for hiding this comment

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

remove comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed.

@@ -412,7 +412,7 @@ func (ns *GCENodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGe
}, nil
}

available, capacity, used, inodesFree, inodes, inodesUsed, err := ns.VolumeStatter.StatFS(req.VolumePath)
available, capacity, used, inodesFree, inodes, inodesUsed, err := getStatFS(ns.VolumeStatter, req.VolumePath)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand why have to to thunk through getStatFS and can't just use the Statter interface directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right, directly use Statter is good. I kind of follow some other calls, which seem have to use this route.
updated the code. PTAL

add support for getting volume stats for windows
@mattcary
Copy link
Contributor

/assign
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2020
@jingxu97
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 44749c3 into kubernetes-sigs:master Oct 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VolumeStats does not work for Windows
3 participants