Skip to content

Commit

Permalink
scenario when exportMap is already exists (#1279)
Browse files Browse the repository at this point in the history
Signed-off-by: badri-pathak <[email protected]>
Co-authored-by: Abhishek Jain <[email protected]>
  • Loading branch information
badri-pathak and Jainbrt authored Jan 28, 2025
1 parent 7f39cef commit afbb8cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion driver/csiplugin/connectors/rest_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ func (s *SpectrumRestV2) CreateNodeMappingAFMWithCos(ctx context.Context, export
}
hostname := parsedURL.Hostname()

exportMapReq.ExportMap = append(exportMapReq.ExportMap, fmt.Sprintf(hostname+"/"+gatewayNodeName))
exportMapReq.ExportMap = append(exportMapReq.ExportMap, hostname+"/"+gatewayNodeName)

exportMapReq.NoServerResolution = true

Expand All @@ -822,6 +822,10 @@ func (s *SpectrumRestV2) CreateNodeMappingAFMWithCos(ctx context.Context, export

err = s.doHTTP(ctx, createExportMapURL, "POST", &createExportMapResponse, exportMapReq)
if err != nil {
if strings.Contains(createExportMapResponse.Status.Message, "Mapping "+exportMapName+" already exists") {
klog.V(6).Infof("[%s] Failed to create NodeMappingAFMWithCos exportMapName, exportMap is already exists. So returning success %v", utils.GetLoggerId(ctx), err)
return nil
}
klog.Errorf("[%s] Failed to create NodeMappingAFMWithCos exportMapName: %s, error: %v", loggerID, exportMapName, err)
return err
}
Expand Down

0 comments on commit afbb8cc

Please sign in to comment.