Skip to content

Commit

Permalink
[PWX-36750] Removed IP format validation for Pure NFS endpoint for FBDA
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Shinde <[email protected]>
  • Loading branch information
vinayakshnd committed May 9, 2024
1 parent 57f2ab1 commit ade3598
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion SDK_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
### v0.184.0 - (04/30/2024)

* Added new `pure_nfs_endpoint_opt` field to VolumeSpecUpdate message in proto.
*

### v0.183.0 - (04/30/2024)

Expand Down
4 changes: 0 additions & 4 deletions api/spec/spec_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package spec

import (
"fmt"
"net"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -656,9 +655,6 @@ func (d *specHandler) UpdateSpecFromOpts(opts map[string]string, spec *api.Volum
if spec.ProxySpec.PureFileSpec == nil {
spec.ProxySpec.PureFileSpec = &api.PureFileSpec{}
}
if net.ParseIP(v) == nil {
return nil, nil, nil, fmt.Errorf("invalid Pure NFS endpoint: %v", v)
}
spec.ProxySpec.PureFileSpec.NfsEndpoint = v
case api.SpecIoThrottleRdIOPS:
if spec.IoThrottle == nil {
Expand Down
17 changes: 11 additions & 6 deletions api/spec/spec_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,18 +526,23 @@ func TestPureNFSEndpoint(t *testing.T) {
require.Equal(t, proxySpec.GetPureFileSpec().GetNfsEndpoint(), nfsEndpoint)

nfsEndpoint = ""
_, _, _, err = s.SpecFromOpts(map[string]string{
spec, _, _, err = s.SpecFromOpts(map[string]string{
api.SpecPureNFSEnpoint: nfsEndpoint,
})
require.Error(t, err, "Failed to parse nfs endpoint parameter")
require.ErrorContains(t, err, "invalid Pure NFS endpoint")
require.NoError(t, err)
proxySpec = spec.GetProxySpec()
require.NotNil(t, proxySpec)
require.Equal(t, proxySpec.GetPureFileSpec().GetNfsEndpoint(), nfsEndpoint)

nfsEndpoint = "abc"
_, _, _, err = s.SpecFromOpts(map[string]string{
spec, _, _, err = s.SpecFromOpts(map[string]string{
api.SpecPureNFSEnpoint: nfsEndpoint,
})
require.Error(t, err, "Failed to parse nfs endpoint parameter")
require.ErrorContains(t, err, "invalid Pure NFS endpoint")

require.NoError(t, err)
proxySpec = spec.GetProxySpec()
require.NotNil(t, proxySpec)
require.Equal(t, proxySpec.GetPureFileSpec().GetNfsEndpoint(), nfsEndpoint)
}

func TestXattr(t *testing.T) {
Expand Down

0 comments on commit ade3598

Please sign in to comment.