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

Make capitalization of 'Inode' consistent #1777

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The AWS EBS CSI Driver supports [tagging](tagging.md) through `StorageClass.para
| "kmsKeyId" | | | The full ARN of the key to use when encrypting the volume. If not specified, AWS will use the default KMS key for the region the volume is in. This will be an auto-generated key called `/aws/ebs` if not changed. |
| "blockSize" | | | The block size to use when formatting the underlying filesystem. Only supported on linux nodes and with fstype `ext2`, `ext3`, `ext4`, or `xfs`. |
| "inodeSize" | | | The inode size to use when formatting the underlying filesystem. Only supported on linux nodes and with fstype `ext2`, `ext3`, `ext4`, or `xfs`. |
| "bytesPerINode" | | | The `bytes-per-inode` to use when formatting the underlying filesystem. Only supported on linux nodes and with fstype `ext2`, `ext3`, `ext4`. |
| "numberOfINodes" | | | The `number-of-inodes` to use when formatting the underlying filesystem. Only supported on linux nodes and with fstype `ext2`, `ext3`, `ext4`. |
| "bytesPerInode" | | | The `bytes-per-inode` to use when formatting the underlying filesystem. Only supported on linux nodes and with fstype `ext2`, `ext3`, `ext4`. |
| "numberOfInodes" | | | The `number-of-inodes` to use when formatting the underlying filesystem. Only supported on linux nodes and with fstype `ext2`, `ext3`, `ext4`. |
## Restrictions
* `gp3` is currently not supported on outposts. Outpost customers need to use a different type for their volumes.
* If the requested IOPS (either directly from `iops` or from `iopsPerGB` multiplied by the volume's capacity) produces a value above the maximum IOPS allowed for the [volume type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html), the IOPS will be capped at the maximum value allowed. If the value is lower than the minimal supported IOPS value per volume, either an error is returned (the default behavior), or the value is increased to fit into the supported range when `allowautoiopspergbincrease` is `"true"`.
Expand Down
22 changes: 11 additions & 11 deletions pkg/driver/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ const (
// BlockSizeKey configures the block size when formatting a volume
BlockSizeKey = "blocksize"

// INodeSizeKey configures the inode size when formatting a volume
INodeSizeKey = "inodesize"
// InodeSizeKey configures the inode size when formatting a volume
InodeSizeKey = "inodesize"

// BytesPerINodeKey configures the `bytes-per-inode` when formatting a volume
BytesPerINodeKey = "bytesperinode"
// BytesPerInodeKey configures the `bytes-per-inode` when formatting a volume
BytesPerInodeKey = "bytesperinode"

// NumberOfINodesKey configures the `number-of-inodes` when formatting a volume
NumberOfINodesKey = "numberofinodes"
// NumberOfInodesKey configures the `number-of-inodes` when formatting a volume
NumberOfInodesKey = "numberofinodes"

// TagKeyPrefix contains the prefix of a volume parameter that designates it as
// a tag to be attached to the resource
Expand Down Expand Up @@ -198,16 +198,16 @@ var (
},
FSTypeXfs: {
NotSupportedParams: map[string]struct{}{
BytesPerINodeKey: {},
NumberOfINodesKey: {},
BytesPerInodeKey: {},
NumberOfInodesKey: {},
},
},
FSTypeNtfs: {
NotSupportedParams: map[string]struct{}{
BlockSizeKey: {},
INodeSizeKey: {},
BytesPerINodeKey: {},
NumberOfINodesKey: {},
InodeSizeKey: {},
BytesPerInodeKey: {},
NumberOfInodesKey: {},
},
},
}
Expand Down
34 changes: 17 additions & 17 deletions pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ func (d *controllerService) CreateVolume(ctx context.Context, req *csi.CreateVol
}
blockSize string
inodeSize string
bytesPerINode string
numberOfINodes string
bytesPerInode string
numberOfInodes string
)

tProps := new(template.PVProps)
Expand Down Expand Up @@ -192,21 +192,21 @@ func (d *controllerService) CreateVolume(ctx context.Context, req *csi.CreateVol
return nil, status.Errorf(codes.InvalidArgument, "Could not parse blockSize (%s): %v", value, err)
}
blockSize = value
case INodeSizeKey:
case InodeSizeKey:
if isAlphanumeric := util.StringIsAlphanumeric(value); !isAlphanumeric {
return nil, status.Errorf(codes.InvalidArgument, "Could not parse inodeSize (%s): %v", value, err)
}
inodeSize = value
case BytesPerINodeKey:
case BytesPerInodeKey:
if isAlphanumeric := util.StringIsAlphanumeric(value); !isAlphanumeric {
return nil, status.Errorf(codes.InvalidArgument, "Could not parse bytesPerINode (%s): %v", value, err)
return nil, status.Errorf(codes.InvalidArgument, "Could not parse bytesPerInode (%s): %v", value, err)
}
bytesPerINode = value
case NumberOfINodesKey:
bytesPerInode = value
case NumberOfInodesKey:
if isAlphanumeric := util.StringIsAlphanumeric(value); !isAlphanumeric {
return nil, status.Errorf(codes.InvalidArgument, "Could not parse numberOfINodes (%s): %v", value, err)
return nil, status.Errorf(codes.InvalidArgument, "Could not parse numberOfInodes (%s): %v", value, err)
}
numberOfINodes = value
numberOfInodes = value
default:
if strings.HasPrefix(key, TagKeyPrefix) {
scTags = append(scTags, value)
Expand All @@ -225,20 +225,20 @@ func (d *controllerService) CreateVolume(ctx context.Context, req *csi.CreateVol
}
}
if len(inodeSize) > 0 {
responseCtx[INodeSizeKey] = inodeSize
if err = validateVolumeCapabilities(req.GetVolumeCapabilities(), INodeSizeKey, FileSystemConfigs); err != nil {
responseCtx[InodeSizeKey] = inodeSize
if err = validateVolumeCapabilities(req.GetVolumeCapabilities(), InodeSizeKey, FileSystemConfigs); err != nil {
return nil, err
}
}
if len(bytesPerINode) > 0 {
responseCtx[BytesPerINodeKey] = bytesPerINode
if err = validateVolumeCapabilities(req.GetVolumeCapabilities(), BytesPerINodeKey, FileSystemConfigs); err != nil {
if len(bytesPerInode) > 0 {
responseCtx[BytesPerInodeKey] = bytesPerInode
if err = validateVolumeCapabilities(req.GetVolumeCapabilities(), BytesPerInodeKey, FileSystemConfigs); err != nil {
return nil, err
}
}
if len(numberOfINodes) > 0 {
responseCtx[NumberOfINodesKey] = numberOfINodes
if err = validateVolumeCapabilities(req.GetVolumeCapabilities(), NumberOfINodesKey, FileSystemConfigs); err != nil {
if len(numberOfInodes) > 0 {
responseCtx[NumberOfInodesKey] = numberOfInodes
if err = validateVolumeCapabilities(req.GetVolumeCapabilities(), NumberOfInodesKey, FileSystemConfigs); err != nil {
return nil, err
}
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/driver/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1670,21 +1670,21 @@ func TestCreateVolumeWithFormattingParameters(t *testing.T) {
{
name: "success with inode size",
formattingOptionParameters: map[string]string{
INodeSizeKey: "256",
InodeSizeKey: "256",
},
errExpected: false,
},
{
name: "success with bytes-per-inode",
formattingOptionParameters: map[string]string{
BytesPerINodeKey: "8192",
BytesPerInodeKey: "8192",
},
errExpected: false,
},
{
name: "success with number-of-inodes",
formattingOptionParameters: map[string]string{
NumberOfINodesKey: "13107200",
NumberOfInodesKey: "13107200",
},
errExpected: false,
},
Expand All @@ -1698,21 +1698,21 @@ func TestCreateVolumeWithFormattingParameters(t *testing.T) {
{
name: "failure with inode size",
formattingOptionParameters: map[string]string{
INodeSizeKey: "wrong_value",
InodeSizeKey: "wrong_value",
},
errExpected: true,
},
{
name: "failure with bytes-per-inode",
formattingOptionParameters: map[string]string{
BytesPerINodeKey: "wrong_value",
BytesPerInodeKey: "wrong_value",
},
errExpected: true,
},
{
name: "failure with number-of-inodes",
formattingOptionParameters: map[string]string{
NumberOfINodesKey: "wrong_value",
NumberOfInodesKey: "wrong_value",
},
errExpected: true,
},
Expand Down
14 changes: 7 additions & 7 deletions pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ func (d *nodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol
if err != nil {
return nil, err
}
inodeSize, err := recheckFormattingOptionParameter(context, INodeSizeKey, FileSystemConfigs, fsType)
inodeSize, err := recheckFormattingOptionParameter(context, InodeSizeKey, FileSystemConfigs, fsType)
if err != nil {
return nil, err
}
bytesPerINode, err := recheckFormattingOptionParameter(context, BytesPerINodeKey, FileSystemConfigs, fsType)
bytesPerInode, err := recheckFormattingOptionParameter(context, BytesPerInodeKey, FileSystemConfigs, fsType)
if err != nil {
return nil, err
}
numINodes, err := recheckFormattingOptionParameter(context, NumberOfINodesKey, FileSystemConfigs, fsType)
numInodes, err := recheckFormattingOptionParameter(context, NumberOfInodesKey, FileSystemConfigs, fsType)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -256,11 +256,11 @@ func (d *nodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol
}
formatOptions = append(formatOptions, option, inodeSize)
}
if len(bytesPerINode) > 0 {
formatOptions = append(formatOptions, "-i", bytesPerINode)
if len(bytesPerInode) > 0 {
formatOptions = append(formatOptions, "-i", bytesPerInode)
}
if len(numINodes) > 0 {
formatOptions = append(formatOptions, "-N", numINodes)
if len(numInodes) > 0 {
formatOptions = append(formatOptions, "-N", numInodes)
}
err = d.mounter.FormatAndMountSensitiveWithFormatOptions(source, target, fsType, mountOptions, nil, formatOptions)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/driver/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func TestNodeStageVolume(t *testing.T) {
StagingTargetPath: targetPath,
VolumeCapability: stdVolCap,
VolumeId: volumeID,
VolumeContext: map[string]string{INodeSizeKey: "256"},
VolumeContext: map[string]string{InodeSizeKey: "256"},
},
expectMock: func(mockMounter MockMounter, mockDeviceIdentifier MockDeviceIdentifier) {
successExpectMock(mockMounter, mockDeviceIdentifier)
Expand All @@ -307,7 +307,7 @@ func TestNodeStageVolume(t *testing.T) {
},
},
VolumeId: volumeID,
VolumeContext: map[string]string{INodeSizeKey: "256"},
VolumeContext: map[string]string{InodeSizeKey: "256"},
},
expectMock: func(mockMounter MockMounter, mockDeviceIdentifier MockDeviceIdentifier) {
successExpectMock(mockMounter, mockDeviceIdentifier)
Expand All @@ -321,7 +321,7 @@ func TestNodeStageVolume(t *testing.T) {
StagingTargetPath: targetPath,
VolumeCapability: stdVolCap,
VolumeId: volumeID,
VolumeContext: map[string]string{BytesPerINodeKey: "8192"},
VolumeContext: map[string]string{BytesPerInodeKey: "8192"},
},
expectMock: func(mockMounter MockMounter, mockDeviceIdentifier MockDeviceIdentifier) {
successExpectMock(mockMounter, mockDeviceIdentifier)
Expand All @@ -335,7 +335,7 @@ func TestNodeStageVolume(t *testing.T) {
StagingTargetPath: targetPath,
VolumeCapability: stdVolCap,
VolumeId: volumeID,
VolumeContext: map[string]string{NumberOfINodesKey: "13107200"},
VolumeContext: map[string]string{NumberOfInodesKey: "13107200"},
},
expectMock: func(mockMounter MockMounter, mockDeviceIdentifier MockDeviceIdentifier) {
successExpectMock(mockMounter, mockDeviceIdentifier)
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/format_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ var (
CreateVolumeParameterValue: "1024",
},
{
CreateVolumeParameterKey: ebscsidriver.INodeSizeKey,
CreateVolumeParameterKey: ebscsidriver.InodeSizeKey,
CreateVolumeParameterValue: "512",
},
{
CreateVolumeParameterKey: ebscsidriver.BytesPerINodeKey,
CreateVolumeParameterKey: ebscsidriver.BytesPerInodeKey,
CreateVolumeParameterValue: "8192",
},
{
CreateVolumeParameterKey: ebscsidriver.NumberOfINodesKey,
CreateVolumeParameterKey: ebscsidriver.NumberOfInodesKey,
CreateVolumeParameterValue: "200192",
},
}
Expand Down