summaryrefslogtreecommitdiff
path: root/config.el
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2026-10-13 12:51:27 +0200
committerLibravatar Terin Stock <terinjokes@gmail.com>2026-10-13 12:51:27 +0200
commit92997f2364125b2eb1826e11fcaa3e322efb8fda (patch)
treed10f3bcd8dffad38baeee94069a876776d9a0833 /config.el
parentfix: ensure tramp is loaded (diff)
downloaddoom-emacs-92997f2364125b2eb1826e11fcaa3e322efb8fda.tar.xz
feat(kubed): prompt if context is not set
Advice kubed--configured-context-and-namespace to prompt for context and namespace when not set in the current executation environment or set as current-context in KUBECONFIG. Otherwise most actions in kubed fail as it attempts to load the context from KUBECONFIG and fails.
Diffstat (limited to 'config.el')
-rw-r--r--config.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/config.el b/config.el
index 567ba7d..a06dc10 100644
--- a/config.el
+++ b/config.el
@@ -89,6 +89,21 @@
(use-package! meson-mode)
(use-package! ebuild-mode)
+(use-package! kubed
+ :config
+ (map! :leader
+ :desc "kubed"
+ "k" kubed-prefix-map)
+
+ (defadvice! +kured-prompt-when-no-current-context (fn)
+ "Prompt for context and namespace if not set in the local context or in KUBECONFIG"
+ :around #'kubed--configured-context-and-namespace
+ (or (funcall fn)
+ (let ((context (ignore-errors (kubed-current-context))))
+ (when (string-empty-p (or context ""))
+ (setq context (kubed-read-context "Context")))
+ (cons context (kubed-read-default-namespace-non-empty context))))))
+
(after! tramp
(tramp-enable-run0-method)