-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kubectl-plugin): non-zero exit code on error
Signed-off-by: Vandana Varakantham <vandana.varakantham@datacore.com>
- Loading branch information
1 parent
baa101c
commit 4ba2a71
Showing
13 changed files
with
248 additions
and
75 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
use snafu::Snafu; | ||
|
||
/// All errors returned when kubectl plugin command fails | ||
#[derive(Debug, Snafu)] | ||
#[snafu(visibility(pub))] | ||
#[allow(clippy::enum_variant_names)] | ||
pub enum Error { | ||
/// Error when listing block devices fails. | ||
#[snafu(display("Failed to list blockdevices for node {id} . Error {source}"))] | ||
GetBlockDevicesError { | ||
id: String, | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when get node request fails. | ||
#[snafu(display("Failed to get node {id}. Error {source}"))] | ||
GetNodeError { | ||
id: String, | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when node cordon request fails. | ||
#[snafu(display("Failed to get node {id}. Error {source}"))] | ||
NodeCordonError { | ||
id: String, | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when node uncordon request fails. | ||
#[snafu(display("Failed to uncordon node {id}. Error {source}"))] | ||
NodeUncordonError { | ||
id: String, | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when put node drain request fails. | ||
#[snafu(display("Failed to put node drain {id}. Error {source}"))] | ||
PutNodeDrainError { | ||
id: String, | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when list nodes request fails. | ||
#[snafu(display("Failed to list nodes. Error {source}"))] | ||
ListNodesError { | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when get pool request fails. | ||
#[snafu(display("Failed to get pool {id}. Error {source}"))] | ||
GetPoolError { | ||
id: String, | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when list pools request fails. | ||
#[snafu(display("Failed to list pools. Error {source}"))] | ||
ListPoolsError { | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when get volume request fails. | ||
#[snafu(display("Failed to get volume {id}. Error {source}"))] | ||
GetVolumeError { | ||
id: String, | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when get rebuild history for volume request fails. | ||
#[snafu(display("Failed to get rebuild history for volume {id}. Error {source}"))] | ||
GetRebuildHistory { | ||
id: String, | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when scale volume request fails. | ||
#[snafu(display("Failed to scale volume {id}. Error {source}"))] | ||
ScaleVolumeError { | ||
id: String, | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
/// Error when list snapshots request fails. | ||
#[snafu(display("Failed to list volume snapshots. Error {source}"))] | ||
ListSnapshotsError { | ||
source: openapi::tower::client::Error<openapi::models::RestJsonError>, | ||
}, | ||
} |
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.