-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refector: refect the pouch's volume module
1. don't return error when create volume is exist. 2. Refect the `VolumeID` to `VolumeContext`. 3. remove unuse field `Selectors` in `VolumeContext`. 4. set directory's quota id after check the limit of device. 5. get volume's size in `Extra` field. 6. add more options to set volume's size, you also can use "-o size=10g" or "-o Size=10g" or "-o opt.Size=10g" to set volume's size. 7. merge volume's error into `pkg/errtypes` 8. remove unuse package `pkg/serializer` Signed-off-by: Rudy Zhang <[email protected]>
- Loading branch information
Showing
28 changed files
with
460 additions
and
553 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package errtypes | ||
|
||
var ( | ||
// ErrVolumeInUse represents that volume in use. | ||
ErrVolumeInUse = errorType{codeInUse, "volume is in use"} | ||
|
||
// ErrVolumeNotFound represents that no such volume. | ||
ErrVolumeNotFound = errorType{codeNotFound, "no such volume"} | ||
|
||
// ErrVolumeExisted represents error is "volume exist" | ||
ErrVolumeExisted = errorType{codeVolumeExisted, "volume exist"} | ||
|
||
// ErrVolumeDriverNotFound represents error is "driver not found" | ||
ErrVolumeDriverNotFound = errorType{codeVolumeDriverNotFound, "driver not found"} | ||
|
||
// ErrVolumeMetaNotFound represents error is "local meta not found" | ||
ErrVolumeMetaNotFound = errorType{codeVolumeMetaNotFound, "local meta not found"} | ||
) | ||
|
||
// IsVolumeInUse is used to check error is volume in use. | ||
func IsVolumeInUse(err error) bool { | ||
return checkError(err, codeInUse) | ||
} | ||
|
||
// IsVolumeNotFound is used to check error is volumeNotFound or not. | ||
func IsVolumeNotFound(err error) bool { | ||
return checkError(err, codeNotFound) | ||
} | ||
|
||
// IsVolumeExisted is used to check error is volumeExisted or not. | ||
func IsVolumeExisted(err error) bool { | ||
return checkError(err, codeVolumeExisted) | ||
} | ||
|
||
// IsVolumeDriverNotFound is used to check error is driverNotFound or not. | ||
func IsVolumeDriverNotFound(err error) bool { | ||
return checkError(err, codeVolumeDriverNotFound) | ||
} | ||
|
||
// IsVolumeMetaNotFound is used to check error is localMetaNotFound or not. | ||
func IsVolumeMetaNotFound(err error) bool { | ||
return checkError(err, codeVolumeMetaNotFound) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.