quickseal 0.1.4

Create Kubernetes SealedSecrets with a single secure command
Documentation
//! Kubernetes cluster context information

/// Represents the current Kubernetes cluster context
#[derive(Debug, Clone)]
pub struct ClusterContext {
    /// Name of the current kubectl context
    pub context_name: String,
    /// Name of the cluster from kubeconfig
    pub cluster_name: String,
    /// Kubernetes API server URL
    pub cluster_server: String,
    /// Default namespace from context (if any)
    pub namespace: Option<String>,
    /// Username/identity from context
    pub user: String,
}

impl ClusterContext {
    /// Create a new ClusterContext
    pub fn new(
        context_name: String,
        cluster_name: String,
        cluster_server: String,
        namespace: Option<String>,
        user: String,
    ) -> Self {
        Self {
            context_name,
            cluster_name,
            cluster_server,
            namespace,
            user,
        }
    }

    /// Format context for display to user
    pub fn display(&self) -> String {
        format!(
            "Current Kubernetes context: {} ({})",
            self.context_name, self.cluster_server
        )
    }
}