Skip to content

Commit

Permalink
[PWX-36749] Added pure_nfs_endpoint to PureFileSpec volume spec
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Shinde <[email protected]>
  • Loading branch information
vinayakshnd committed Apr 15, 2024
1 parent e80fd7f commit e006f0e
Show file tree
Hide file tree
Showing 6 changed files with 5,603 additions and 5,568 deletions.
1 change: 1 addition & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const (
SpecBackendPureBlock = "pure_block"
SpecBackendPureFile = "pure_file"
SpecPureFileExportRules = "pure_export_rules"
SpecPureNFSEnpoint = "pure_nfs_endpoint"
SpecIoThrottleRdIOPS = "io_throttle_rd_iops"
SpecIoThrottleWrIOPS = "io_throttle_wr_iops"
SpecIoThrottleRdBW = "io_throttle_rd_bw"
Expand Down
11,146 changes: 5,578 additions & 5,568 deletions api/api.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ message PureBlockSpec {
message PureFileSpec {
string export_rules = 1;
string full_vol_name = 2;
string nfs_endpoint = 3;
}

// ProxySpec defines how this volume will reflect an external data source.
Expand Down
3 changes: 3 additions & 0 deletions api/server/sdk/api/api.swagger.json

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

8 changes: 8 additions & 0 deletions api/spec/spec_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,14 @@ func (d *specHandler) UpdateSpecFromOpts(opts map[string]string, spec *api.Volum
spec.ProxySpec.PureFileSpec = &api.PureFileSpec{}
}
spec.ProxySpec.PureFileSpec.ExportRules = v
case api.SpecPureNFSEnpoint:
if spec.ProxySpec == nil {
spec.ProxySpec = &api.ProxySpec{}
}
if spec.ProxySpec.PureFileSpec == nil {
spec.ProxySpec.PureFileSpec = &api.PureFileSpec{}
}
spec.ProxySpec.PureFileSpec.NfsEndpoint = v
case api.SpecIoThrottleRdIOPS:
if spec.IoThrottle == nil {
spec.IoThrottle = &api.IoThrottle{}
Expand Down
12 changes: 12 additions & 0 deletions api/spec/spec_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,18 @@ func TestPureBackendSpec(t *testing.T) {
require.Error(t, err, "Failed to parse backend parameter")
}

func TestPureNFSEndpoint(t *testing.T) {
nfsEndpoint := "10.68.101.80"
s := NewSpecHandler()
spec, _, _, err := s.SpecFromOpts(map[string]string{
api.SpecPureNFSEnpoint: nfsEndpoint,
})
require.NoError(t, err)
proxySpec := spec.GetProxySpec()
require.NotNil(t, proxySpec)
require.Equal(t, proxySpec.GetPureFileSpec().GetNFSEndpoint(), nfsEndpoint)
}

func TestXattr(t *testing.T) {
testSpecOptString(t, api.SpecCowOnDemand, "true")

Expand Down

0 comments on commit e006f0e

Please sign in to comment.