Skip to content

Commit

Permalink
[build] enhance api attach volume
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed Jul 1, 2024
1 parent c34df86 commit a18e2dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/cloud/icloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Cloud interface {
GetVolumeByName(pvolName string) (*lsentity.Volume, lserr.IError)
GetVolume(volumeID string) (*lsentity.Volume, lserr.IError)
DeleteVolume(volID string) lserr.IError
AttachVolume(instanceID, volumeID string) (*lsentity.Volume, error)
AttachVolume(instanceID, volumeID string) (*lsentity.Volume, lserr.IError)
DetachVolume(instanceID, volumeID string) lserr.IError
ModifyVolumeType(pvolumeId, pvolumeType string, psize int) lserr.IError
ResizeOrModifyDisk(volumeID string, newSizeBytes int64, options *ModifyDiskOptions) (newSize int64, err error)
Expand Down
6 changes: 3 additions & 3 deletions pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ func (s *controllerService) ControllerPublishVolume(pctx lctx.Context, preq *lcs
llog.InfoS("[INFO] - ControllerPublishVolume: attaching volume into the instance", "volumeID", volumeID, "nodeID", nodeID)

// Attach the volume and wait for it to be attached
_, err = s.cloud.AttachVolume(nodeID, volumeID)
if err != nil {
llog.ErrorS(err, "[ERROR] - ControllerPublishVolume; failed to attach volume to instance", "volumeID", volumeID, "nodeID", nodeID)
_, ierr := s.cloud.AttachVolume(nodeID, volumeID)
if ierr != nil {
llog.ErrorS(ierr.GetError(), "[ERROR] - ControllerPublishVolume; failed to attach volume to instance", "volumeID", volumeID, "nodeID", nodeID)
return nil, ErrAttachVolume(volumeID, nodeID)
}

Expand Down

0 comments on commit a18e2dc

Please sign in to comment.