@@ -35,7 +35,7 @@ import (
3535
3636const errConnectionRefused string = "connection refused"
3737const errNoSuchHost string = "no such host"
38- const errContextDeadlineExceeded string = "context deadline exceeded"
38+ const errContextDeadlineExceeded string = "context deadline exceeded"
3939
4040var GetLoggerId = utils .GetLoggerId
4141
@@ -657,10 +657,15 @@ func (s *SpectrumRestV2) LinkFileset(ctx context.Context, filesystemName string,
657657 return nil
658658}
659659
660- func (s * SpectrumRestV2 ) UnlinkFileset (ctx context.Context , filesystemName string , filesetName string ) error {
660+ func (s * SpectrumRestV2 ) UnlinkFileset (ctx context.Context , filesystemName string , filesetName string , force bool ) error {
661661 klog .V (4 ).Infof ("[%s] rest_v2 UnlinkFileset. filesystem: %s, fileset: %s" , utils .GetLoggerId (ctx ), filesystemName , filesetName )
662662
663- unlinkFilesetURL := fmt .Sprintf ("scalemgmt/v2/filesystems/%s/filesets/%s/link?force=True" , filesystemName , filesetName )
663+ var unlinkFilesetURL string
664+ if force {
665+ unlinkFilesetURL = fmt .Sprintf ("scalemgmt/v2/filesystems/%s/filesets/%s/link?force=True" , filesystemName , filesetName )
666+ } else {
667+ unlinkFilesetURL = fmt .Sprintf ("scalemgmt/v2/filesystems/%s/filesets/%s/link" , filesystemName , filesetName )
668+ }
664669 unlinkFilesetResponse := GenericResponse {}
665670
666671 err := s .doHTTP (ctx , unlinkFilesetURL , "DELETE" , & unlinkFilesetResponse , nil )
@@ -1039,7 +1044,7 @@ func (s *SpectrumRestV2) doHTTP(ctx context.Context, urlSuffix string, method st
10391044
10401045 activeEndpointFound := false
10411046 if err != nil {
1042- if strings .Contains (err .Error (), errConnectionRefused ) || strings .Contains (err .Error (), errNoSuchHost ) || strings .Contains (err .Error (), errContextDeadlineExceeded ){
1047+ if strings .Contains (err .Error (), errConnectionRefused ) || strings .Contains (err .Error (), errNoSuchHost ) || strings .Contains (err .Error (), errContextDeadlineExceeded ) {
10431048 klog .Errorf ("[%s] rest_v2 doHTTP: Error in connecting to GUI endpoint %s: %v, checking next endpoint" , utils .GetLoggerId (ctx ), endpoint , err )
10441049 // Out of n endpoints, one has failed already, so loop over the
10451050 // remaining n-1 endpoints till we get an active GUI endpoint.
0 commit comments