Skip to main content

rkubectl_app/cli/command/
troubleshoot.rs

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