-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow extending volume size with inUse status #1174
Open
wisererik
wants to merge
1
commit into
sodafoundation:development
Choose a base branch
from
wisererik:onlineresize
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -446,8 +446,8 @@ func CreateVolumeSnapshotDBEntry(ctx *c.Context, in *model.VolumeSnapshotSpec) ( | |
log.Error("get volume failed in create volume snapshot method: ", err) | ||
return nil, err | ||
} | ||
if vol.Status != model.VolumeAvailable && vol.Status != model.VolumeInUse { | ||
errMsg := "only the status of volume is available or in-use, the snapshot can be created" | ||
if vol.Status != model.VolumeAvailable { | ||
errMsg := "only the status of volume is available, the snapshot can be created" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is these messages correct? |
||
log.Error(errMsg) | ||
return nil, errors.New(errMsg) | ||
} | ||
|
@@ -504,8 +504,8 @@ func CreateReplicationDBEntry(ctx *c.Context, in *model.ReplicationSpec) (*model | |
log.Error("get primary volume failed in create volume replication method: ", err) | ||
return nil, err | ||
} | ||
if pVol.Status != model.VolumeAvailable && pVol.Status != model.VolumeInUse { | ||
var errMsg = fmt.Errorf("only the status of primary volume is available or in-use, the replicaiton can be created") | ||
if pVol.Status != model.VolumeAvailable { | ||
var errMsg = fmt.Errorf("only the status of primary volume is available, the replicaiton can be created") | ||
log.Error(errMsg) | ||
return nil, errMsg | ||
} | ||
|
@@ -514,8 +514,8 @@ func CreateReplicationDBEntry(ctx *c.Context, in *model.ReplicationSpec) (*model | |
log.Error("get secondary volume failed in create volume replication method: ", err) | ||
return nil, err | ||
} | ||
if sVol.Status != model.VolumeAvailable && sVol.Status != model.VolumeInUse { | ||
var errMsg = fmt.Errorf("only the status of secondary volume is available or in-use, the replicaiton can be created") | ||
if sVol.Status != model.VolumeAvailable { | ||
var errMsg = fmt.Errorf("only the status of secondary volume is available, the replicaiton can be created") | ||
log.Error(errMsg) | ||
return nil, errMsg | ||
} | ||
|
@@ -800,7 +800,7 @@ func ValidateAddVolumes(ctx *c.Context, volumes []*model.VolumeSpec, addVolumes | |
if !utils.Contained(addVolRef.ProfileId, vg.Profiles) { | ||
return nil, fmt.Errorf("cannot add volume %s to group %s , volume profile is not supported by the group.", addVolRef.Id, vg.Id) | ||
} | ||
if addVolRef.Status != model.VolumeAvailable && addVolRef.Status != model.VolumeInUse { | ||
if addVolRef.Status != model.VolumeAvailable { | ||
return nil, fmt.Errorf("cannot add volume %s to group %s because volume is in invalid status %s", addVolRef.Id, vg.Id, addVolRef.Status) | ||
} | ||
if addVolRef.PoolId != vg.PoolId { | ||
|
@@ -818,7 +818,7 @@ func ValidateRemoveVolumes(ctx *c.Context, volumes []*model.VolumeSpec, removeVo | |
for _, v := range removeVolumes { | ||
for _, volume := range volumes { | ||
if v == volume.Id { | ||
if volume.Status != model.VolumeAvailable && volume.Status != model.VolumeInUse && volume.Status != model.VolumeError && volume.Status != model.VolumeErrorDeleting { | ||
if volume.Status != model.VolumeAvailable && volume.Status != model.VolumeError && volume.Status != model.VolumeErrorDeleting { | ||
return nil, fmt.Errorf("cannot remove volume %s from group %s, volume is in invalid status %s", volume.Id, vg.Id, volume.Status) | ||
} | ||
break | ||
|
@@ -890,7 +890,7 @@ func DeleteVolumeGroupDBEntry(ctx *c.Context, volumeGroupId string) error { | |
|
||
var volumesUpdate []*model.VolumeSpec | ||
for _, value := range volumes { | ||
if value.AttachStatus == model.VolumeAttached { | ||
if *value.Attached { | ||
msg := fmt.Sprintf("volume %s in group %s is attached. Need to deach first.", value.Id, vg.Id) | ||
log.Error(msg) | ||
return errors.New(msg) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the message be