#[derive(Debug, Clone)]
pub struct ClusterContext {
pub context_name: String,
pub cluster_name: String,
pub cluster_server: String,
pub namespace: Option<String>,
pub user: String,
}
impl 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,
}
}
pub fn display(&self) -> String {
format!(
"Current Kubernetes context: {} ({})",
self.context_name, self.cluster_server
)
}
}