branch: externals/kubed
commit be3c8a7cdee1f832d7b7eed0e367b1a255160d4a
Author: Eshel Yaron <m...@eshelyaron.com>
Commit: Eshel Yaron <m...@eshelyaron.com>

    (kubed-kubectl-command): Add '--context' arg to initial input.
---
 kubed.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kubed.el b/kubed.el
index d5c3cbce4c..8814fc42b6 100644
--- a/kubed.el
+++ b/kubed.el
@@ -3509,8 +3509,11 @@ Interactively, prompt for COMMAND with completion for 
`kubectl' arguments."
                               (transient-prefix-object)))
                  (scope (and prefix (fboundp 'eieio-oref)
                              (eieio-oref prefix 'scope))))
-            (when (or args scope)
-              (concat (string-join (append scope args) " ") " "))))))
+            (or
+             (seq-find (apply-partially #'string-prefix-p "--context=") args)
+             ;; No context argument, add one.
+             (push (concat "--context=" (kubed-local-context)) args))
+            (concat (string-join (append scope args) " ") " ")))))
   (shell-command command))
 
 ;;;###autoload (autoload 'kubed-prefix-map "kubed" nil t 'keymap)

Reply via email to