-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add test to verify storageclass #154
Add test to verify storageclass #154
Conversation
/lgtm |
// fullPath is the pathname of any file within the mounted filesystem. Capacity | ||
// returned here is total capacity available to non-root users, and does not include | ||
// fs reserved space. | ||
func (u *volumeUtil) GetFsAvailableByte(fullPath string) (uint64, 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.
How is this AvailableByte different from available bytes inside kubernetes/pkg/volume/util/fs.go:33 FsInfo?
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.
Thanks for pointing this out. I didn't know there is such a util in kubernetes :) You can take a look at discussion here: #135 (comment) Basically, available from that package returns all available spaces block wise, but there are certain amount of blocks can't be used by normal user. AvailableByte removes those.
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.
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.
Looking at FsInfo, I think it returns all the info that you need here. You could do (usage + available) to get the equivalent.
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.
yeah, usage + available
is basically the idea.
@ianchakeres available in fs.go means remaining bytes available to be consumed, while available here means capacity that can be used by normal users. so we can't change the definition of available in fs.go. It may worth taking a look if returning a new field for availablebytes is necessary though, but i don't know if there is use case. Even if there is, it can be calculated by just using usage+available.
But you raise another IMPORTANT problem, that we should change to a better name......
…class Add test to verify storageclass
Based on #135. Review the last commit will suffice.