-
Notifications
You must be signed in to change notification settings - Fork 807
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
Support specifying inode size for filesystem format #1661
Support specifying inode size for filesystem format #1661
Conversation
Welcome @fgksgf! |
Hi @fgksgf. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
Hi @fgksgf , thanks for submitting the PR. Can you add (in the PR description) what testings have been done? |
Feel free to ignore the Windows test failure, it's due to a separate ongoing issue we're working on. Based on a rough skim of the PR it looks good to me, but I'd like to do an in-depth review and manually test this locally before I give the official lgtm - I'll report back when I get to do that (probably later this week) |
@hanyuel Ok, before that I want to add other inode related parameters those are only supported by ext2, ext3, and ext4, including /cc @ConnorJC3
Thank you for the kind reminder. |
@hanyuel @ConnorJC3 Hello, I just added what testings I have been done, PTAL :) |
3c7e41b
to
53c5092
Compare
/test pull-aws-ebs-csi-driver-e2e-single-az |
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.
I think the current approach is fine for a few exclusion types, but it's not very scalable. I'm also not a big fan of exposing these maps globally. Is it unreasonable to expect that we will add more exclusion types in the future?
Rather than having multiple maps each tracking the support for a single parameter, we should use a single map that tracks the support for all parameters:
type FileSystemConfig struct {
SupportedParams map[string]bool
}
var FileSystemConfigs = make(map[string]FileSystemConfig)
// FSTypeExt2 config
// FSTypeExt3 config
// FSTypeExt4 config
// FSTypeXfs config
// FSTypeNtfs config
FileSystemConfigs[FSTypeNtfs] = FileSystemConfig{
SupportedParams: map[string]bool{
"blockSize": false,
"inodeSize": false,
"bytesPerInode": false,
"numberOfInodes": false,
},
}
and then we can just do
func (fsConfig FileSystemConfig) isParameterSupported(paramName string) bool {
supported, _ := fsConfig.SupportedParams[paramName]
return supported
}
This is easier to reason about and extend. Whenever a new param or fsType is introduced we only have to update FileSystemConfigs
, everything else should work with no further modifications.
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.
This is awesome, lgtm as far as I'm concerned
cc @torredil for review
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.
This is looking very clean now @fgksgf, perfect!
Thank you for your contribution and the very detailed testing section in the PR description, appreciate that.
/hold |
One last request: Will merge this PR once the commits have been squashed. |
address review comments
c92b52a
to
996d1a9
Compare
@fgksgf: The following test failed, say
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. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: torredil 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 |
/lgtm |
Is this a bug fix or adding new feature?
New feature
What is this PR about? / Why do we need it?
Close #1660
What testing is done?
UT and manual test
Manual Test
kubectl exec -it app -- tune2fs -l /dev/nvme1n1
, get the output, save it asbase.txt
, then delete them.inodeSize
inodeSize: "512"
), get the output oftune2fs
, save it asinode-size.txt
, then delete the resourcesbase.txt
withinode-size.txt
:bytesPerINode
bytesPerINode: "8192"
), get the output oftune2fs
:bytes-per-inode = (total blocks * block size) / inode count
, i.e.524288 * 4096 / 262144 = 8192
, we can confirm the parameter works.numberOfINodes
numberOfINodes: "200000"
), get the output oftune2fs
, save it asinode-num.txt
, then delete the resourcesbase.txt
withinode-num.txt
: