@@ -36,6 +36,7 @@ pub enum CmdError {
3636
3737 #[ snafu( display( "failed to get {pod}" ) ) ]
3838 GetPod {
39+ #[ snafu( source( from( kube:: Error , Box :: new) ) ) ]
3940 source : Box < kube:: Error > ,
4041 pod : ObjectRef < Pod > ,
4142 } ,
@@ -48,13 +49,15 @@ pub enum CmdError {
4849
4950 #[ snafu( display( "failed to create ephemeral debug container {container:?} on {pod}" ) ) ]
5051 CreateDebugContainer {
52+ #[ snafu( source( from( kube:: Error , Box :: new) ) ) ]
5153 source : Box < kube:: Error > ,
5254 pod : Box < ObjectRef < Pod > > ,
5355 container : String ,
5456 } ,
5557
5658 #[ snafu( display( "debug container {container:?} on {pod} never became ready" ) ) ]
5759 AwaitDebugContainerReadiness {
60+ #[ snafu( source( from( kube:: runtime:: wait:: Error , Box :: new) ) ) ]
5861 source : Box < kube:: runtime:: wait:: Error > ,
5962 pod : Box < ObjectRef < Pod > > ,
6063 container : String ,
@@ -68,6 +71,7 @@ pub enum CmdError {
6871
6972 #[ snafu( display( "failed to attach to container {container:?} on {pod}" ) ) ]
7073 AttachContainer {
74+ #[ snafu( source( from( kube:: Error , Box :: new) ) ) ]
7175 source : Box < kube:: Error > ,
7276 pod : Box < ObjectRef < Pod > > ,
7377 container : String ,
@@ -149,7 +153,6 @@ impl DebugArgs {
149153 let pod = pods
150154 . get ( & self . pod )
151155 . await
152- . map_err ( Box :: new)
153156 . with_context ( |_| GetPodSnafu { pod : pod_ref ( ) } ) ?;
154157 let template_container = pod
155158 . spec
@@ -193,7 +196,6 @@ impl DebugArgs {
193196 & kube:: api:: Patch :: Strategic ( pod_patch) ,
194197 )
195198 . await
196- . map_err ( Box :: new)
197199 . with_context ( |_| CreateDebugContainerSnafu {
198200 pod : pod_ref ( ) ,
199201 container : & self . container ,
@@ -214,7 +216,6 @@ impl DebugArgs {
214216 } ,
215217 )
216218 . await
217- . map_err ( Box :: new)
218219 . with_context ( |_| AwaitDebugContainerReadinessSnafu {
219220 pod : pod_ref ( ) ,
220221 container : & self . container ,
@@ -244,7 +245,6 @@ impl DebugArgs {
244245 & AttachParams :: interactive_tty ( ) . container ( debug_container_name) ,
245246 )
246247 . await
247- . map_err ( Box :: new)
248248 . with_context ( |_| AttachContainerSnafu {
249249 pod : pod_ref ( ) ,
250250 container : & self . container ,
0 commit comments