Skip to content

Commit

Permalink
Supply the disk mountpoint as a parameter instead
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Oct 30, 2020
1 parent b17ecbd commit 88df534
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/minikube/machine/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func RemoteHostInfo(r command.Runner) (*HostInfo, error, error, error) {
klog.Warningf("Unable to get disk info: %v", diskErr)
}
df := rr.Stdout.String()
disksize, _, err := util.ParseDiskFree(df)
disksize, _, err := util.ParseDiskFree(df, "/")
if err != nil {
klog.Warningf("Unable to parse disk info: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func ParseMemFree(out string) (uint64, uint64, error) {

// ParseDiskFree parses the output of the `df -m` command
// returns: total, available
func ParseDiskFree(out string) (uint64, uint64, error) {
func ParseDiskFree(out string, mountpoint string) (uint64, uint64, error) {
// Filesystem 1M-blocks Used Available Use% Mounted on
// /dev/sda1 39643 3705 35922 10% /
outlines := strings.Split(out, "\n")
Expand All @@ -113,7 +113,7 @@ func ParseDiskFree(out string) (uint64, uint64, error) {
return 0, 0, err
}
m := parsedLine[5]
if m == "/" {
if m == mountpoint {
return t, a, nil
}
}
Expand Down

0 comments on commit 88df534

Please sign in to comment.