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

Fix spec handler and change internal name for fs format options #2384

Merged
merged 1 commit into from
Dec 16, 2023
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: 4 additions & 0 deletions SDK_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Releases

### v0.174.0 - (12/12/2023)

* Fix spec handler and internal naming for fs format options

### v0.173.0 - (11/13/2023)

* Add DefragJob data structure
Expand Down
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const (
SpecExportOptionsEmpty = "empty_export_options"
SpecMountOptions = "mount_options"
// spec key cannot change due to parity with existing PSO storageclasses
SpecFaCreateOptions = "createoptions"
SpecFsFormatOptions = "createoptions"
SpecCSIMountOptions = "csi_mount_options"
SpecSharedv4MountOptions = "sharedv4_mount_options"
SpecProxyProtocolS3 = "s3"
Expand Down
8 changes: 4 additions & 4 deletions api/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5628,7 +5628,7 @@ message SdkVersion {
// SDK version major value of this specification
Major = 0;
// SDK version minor value of this specification
Minor = 173;
Minor = 174;
ppadalia marked this conversation as resolved.
Show resolved Hide resolved
// SDK version patch value of this specification
Patch = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion api/server/sdk/api/api.swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions api/spec/spec_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ var (
SpecIoThrottleRdBWRegex = regexp.MustCompile(api.SpecIoThrottleRdBW + "=([0-9]+),?")
SpecIoThrottleWrBWRegex = regexp.MustCompile(api.SpecIoThrottleWrBW + "=([0-9]+),?")
ReadaheadRegex = regexp.MustCompile(api.SpecReadahead + "=([A-Za-z]+),?")
SpecFsFormatOptionsRegex = regexp.MustCompile(api.SpecFsFormatOptions + "=([0-9A-Za-z_@:./#&+-=]+),?")
)

type specHandler struct {
Expand Down Expand Up @@ -201,10 +202,10 @@ func (d *specHandler) getVal(r *regexp.Regexp, str string) (bool, string) {

func (d *specHandler) DefaultSpec() *api.VolumeSpec {
return &api.VolumeSpec{
Format: api.FSType_FS_TYPE_EXT4,
HaLevel: 1,
IoProfile: api.IoProfile_IO_PROFILE_AUTO,
Xattr: api.Xattr_COW_ON_DEMAND,
Format: api.FSType_FS_TYPE_EXT4,
HaLevel: 1,
IoProfile: api.IoProfile_IO_PROFILE_AUTO,
Xattr: api.Xattr_COW_ON_DEMAND,
FpPreference: true,
}
}
Expand Down Expand Up @@ -545,7 +546,7 @@ func (d *specHandler) UpdateSpecFromOpts(opts map[string]string, spec *api.Volum
return nil, nil, nil, fmt.Errorf("invalid mount options format %v", v)
}
spec.MountOptions.Options = options
case api.SpecFaCreateOptions:
case api.SpecFsFormatOptions:
spec.FaCreateOptions = v
case api.SpecSharedv4MountOptions:
if spec.Sharedv4MountOptions == nil {
Expand Down Expand Up @@ -931,6 +932,9 @@ func (d *specHandler) SpecOptsFromString(
if ok, ioThrottleBW := d.getVal(SpecIoThrottleWrBWRegex, str); ok {
opts[api.SpecIoThrottleWrBW] = ioThrottleBW
}
if ok, fsFormatOptions := d.getVal(SpecFsFormatOptionsRegex, str); ok {
opts[api.SpecFsFormatOptions] = fsFormatOptions
}
return true, opts, name
}

Expand Down
Loading