[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kubed 72593fb84f 02/12: ; (kubed-current-namespace): Us
From: |
ELPA Syncer |
Subject: |
[elpa] externals/kubed 72593fb84f 02/12: ; (kubed-current-namespace): Use buffer-local context. |
Date: |
Thu, 15 Aug 2024 12:58:28 -0400 (EDT) |
branch: externals/kubed
commit 72593fb84f6290fa94cadc4f980f98afa3d70de1
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
; (kubed-current-namespace): Use buffer-local context.
---
kubed.el | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/kubed.el b/kubed.el
index 955c522f73..485b1c05bc 100644
--- a/kubed.el
+++ b/kubed.el
@@ -1703,8 +1703,8 @@ Switch to namespace `%s' and proceed?"
kubed-list-namespace))
((name &optional context)
"Create Kubernetes namespace NAME in CONTEXT.
-Interactively, prompt for NAME. With a prefix argument, prompt for
-CONTEXT instead."
+Interactively, prompt for NAME and use the current context by default.
+With a prefix argument, prompt for CONTEXT instead."
(interactive
(let ((context nil))
(dolist (arg (kubed-transient-args 'kubed-transient-create))
@@ -2344,17 +2344,23 @@ Optional argument DEFAULT is the minibuffer default
argument."
(kubed-current-namespace context))))))
;;;###autoload
-(defun kubed-set-namespace (ns &optional context)
- "Set default Kubernetes namespace in CONTEXT to NS."
+(defun kubed-set-namespace (namespace &optional context)
+ "Set default Kubernetes namespace in CONTEXT to NAMESPACE."
(interactive
- (list (kubed-read-namespace "Set namespace" (kubed-current-namespace))))
+ (let* ((context (kubed-local-context))
+ (context (if current-prefix-arg
+ (kubed-read-context "Context" context)
+ context)))
+ (list (kubed-read-namespace "Set namespace" (kubed-local-namespace
context)
+ nil context)
+ context)))
(unless (zerop
- (apply #'call-process
- kubed-kubectl-program nil nil nil
- "config" "set-context" "--current" "--namespace" ns
- (when context (list "--context" context))))
- (user-error "Failed to set Kubernetes namespace to `%s'" ns))
- (message "Kubernetes namespace is now `%s'." ns))
+ (call-process
+ kubed-kubectl-program nil nil nil
+ "config" "set-context" (or context "--current")
+ "--namespace" namespace))
+ (user-error "Failed to set Kubernetes namespace to `%s'" namespace))
+ (message "Kubernetes namespace is now `%s'." namespace))
(defcustom kubed-read-resource-definition-filter-files-by-kind t
"Whether to filter file completion candidates by their Kubernetes \"kind\".
- [elpa] externals/kubed updated (cca5f42891 -> 0863c58f1a), ELPA Syncer, 2024/08/15
- [elpa] externals/kubed a46344f2b0 01/12: Use buffer-local context in 'kubed-list-*' commands, ELPA Syncer, 2024/08/15
- [elpa] externals/kubed cdeb94ea56 03/12: ; Use local context as default in some prompts, ELPA Syncer, 2024/08/15
- [elpa] externals/kubed a1c741360a 08/12: Teach 'kubed-exec' about buffer-local contexts, ELPA Syncer, 2024/08/15
- [elpa] externals/kubed 003ecf531c 04/12: Teach rollout commands about buffer-local contexts, ELPA Syncer, 2024/08/15
- [elpa] externals/kubed 6c6886bdcd 11/12: New user option 'kubed-default-context-and-namespace', ELPA Syncer, 2024/08/15
- [elpa] externals/kubed 72593fb84f 02/12: ; (kubed-current-namespace): Use buffer-local context.,
ELPA Syncer <=
- [elpa] externals/kubed ae4ba0de59 10/12: Teach additional commands about buffer-local contexts, ELPA Syncer, 2024/08/15
- [elpa] externals/kubed 5b2f47142a 06/12: Teach 'kubed-patch' about buffer-local contexts, ELPA Syncer, 2024/08/15
- [elpa] externals/kubed e545b90c54 05/12: ; (kubed-resource-names): Default to local context and namespace, ELPA Syncer, 2024/08/15
- [elpa] externals/kubed 5954f4f339 09/12: ; Fix regex matching multi-hop Tramp file names, ELPA Syncer, 2024/08/15
- [elpa] externals/kubed 5cb64af942 07/12: Teach 'kubed-diff' about buffer-local contexts, ELPA Syncer, 2024/08/15
- [elpa] externals/kubed 0863c58f1a 12/12: ; Update NEWS.org and bump version to 0.3.2, ELPA Syncer, 2024/08/15