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

Use syscall instead of df to gather volume stats #953

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LucaDev
Copy link
Contributor

@LucaDev LucaDev commented Jul 1, 2023

What this PR does / why we need it:

This PR moves checking the volume stats (inodes, available blocks, etc) to a syscall - making it more resilient to changes in output due to different OSes and their df implementations. It also enables stats to work on systems which do not have df installed like Talos Linux

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2023

Codecov Report

Merging #953 (f143e9d) into main (f45b44d) will not change coverage.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main     #953   +/-   ##
=======================================
  Coverage   29.80%   29.80%           
=======================================
  Files          24       24           
  Lines        1570     1570           
=======================================
  Hits          468      468           
  Misses       1040     1040           
  Partials       62       62           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Luca Kröger <l.kroeger01@gmail.com>
if len(line) == 0 {
continue
}
err := syscall.Statfs(mntPoint, &stats)
Copy link
Member

Choose a reason for hiding this comment

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

This 'syscall' will be executed inside the local-storage container, and will not get the expected result. Actually, the command should be executed on the OS which is outside of the container, that's why it is executed by nsexecutor.
In addition, did you test your change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants