1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use super::*;
pub use auth::Auth;
pub use debug::Debug;
mod auth;
mod debug;
/// Troubleshooting and Debugging Commands
#[derive(Clone, Debug, Subcommand)]
pub enum TroubleshootingDebugging {
/// Show details of a specific resource or group of resources
Describe,
/// Print the logs for a container in a pod
Logs,
/// Attach to a running container
Attach,
/// Execute a command in a container
Exec,
/// Forward one or more local ports to a pod
PortForward,
/// Run a proxy to the Kubernetes API server
Proxy,
/// Copy files and directories to and from containers
Cp,
/// Inspect authorization
#[command(subcommand)]
Auth(Auth),
/// Create debugging sessions for troubleshooting workloads and nodes
Debug,
/// List events
Events,
}
impl TroubleshootingDebugging {
pub async fn exec(self, context: &Context) -> RkResult<()> {
match self {
Self::Describe => Err(RkError::todo()),
Self::Logs => Err(RkError::todo()),
Self::Attach => Err(RkError::todo()),
Self::Exec => Err(RkError::todo()),
Self::PortForward => Err(RkError::todo()),
Self::Proxy => Err(RkError::todo()),
Self::Cp => Err(RkError::todo()),
Self::Auth(auth) => auth.exec(context).await,
Self::Debug => Err(RkError::todo()),
Self::Events => Err(RkError::todo()),
}
}
}