summaryrefslogtreecommitdiffstats
path: root/src/configs
diff options
context:
space:
mode:
authorThomas O'Donnell <andytom@users.noreply.github.com>2019-10-05 11:31:23 +0200
committerMatan Kushner <hello@matchai.me>2019-10-05 18:31:23 +0900
commit5a8777ff45e0883befd63066f169f39d5fb4b791 (patch)
tree4f736579cdc19eabe18943ca007930e5bd6800d1 /src/configs
parent1bf60b3dd513a71eed6025ab1db483327e50cced (diff)
fix: Disable Kubernetes module by default (#488)
Given the global nature of the Kubernetes module, the module has been disabled by default. The opportunity has also been taken to refactor the Kubernetes module to use the new config module.
Diffstat (limited to 'src/configs')
-rw-r--r--src/configs/kubernetes.rs34
-rw-r--r--src/configs/mod.rs1
2 files changed, 35 insertions, 0 deletions
diff --git a/src/configs/kubernetes.rs b/src/configs/kubernetes.rs
new file mode 100644
index 000000000..733919cd1
--- /dev/null
+++ b/src/configs/kubernetes.rs
@@ -0,0 +1,34 @@
+use crate::config::{ModuleConfig, RootModuleConfig, SegmentConfig};
+
+use ansi_term::{Color, Style};
+use starship_module_config_derive::ModuleConfig;
+
+#[derive(Clone, ModuleConfig)]
+pub struct KubernetesConfig<'a> {
+ pub symbol: SegmentConfig<'a>,
+ pub context: SegmentConfig<'a>,
+ pub namespace: SegmentConfig<'a>,
+ pub style: Style,
+ pub disabled: bool,
+}
+
+impl<'a> RootModuleConfig<'a> for KubernetesConfig<'a> {
+ fn new() -> Self {
+ KubernetesConfig {
+ symbol: SegmentConfig {
+ value: "☸ ",
+ style: None,
+ },
+ context: SegmentConfig {
+ value: "",
+ style: None,
+ },
+ namespace: SegmentConfig {
+ value: "",
+ style: None,
+ },
+ style: Color::Cyan.bold(),
+ disabled: true,
+ }
+ }
+}
diff --git a/src/configs/mod.rs b/src/configs/mod.rs
index f557345e4..213ec36a5 100644
--- a/src/configs/mod.rs
+++ b/src/configs/mod.rs
@@ -2,6 +2,7 @@ pub mod aws;
pub mod battery;
pub mod character;
pub mod dotnet;
+pub mod kubernetes;
pub mod rust;
use crate::config::{ModuleConfig, RootModuleConfig};