From e76bd5a2aa9b26bcb9cdbf196ad7ccc38f241d75 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Thu, 25 Jul 2024 14:10:13 +0200 Subject: [PATCH] (kubed-pods-{dired,shell}): Use new Tramp file name syntax --- lisp/net/kubed.el | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lisp/net/kubed.el b/lisp/net/kubed.el index 2eae4de23fd..1d2a206c566 100644 --- a/lisp/net/kubed.el +++ b/lisp/net/kubed.el @@ -834,17 +834,11 @@ Optional argument DEFAULT is the minibuffer default argument." resource) :prefix ("L" #'kubed-logs "F" #'kubed-forward-port-to-pod) (dired "C-d" "Start Dired in home directory of first container of" - ;; FIXME: This doesn't really make sense for other namespaces, - ;; we create the Dired buffer using the correct namespace, but - ;; all subsequent operations in that buffer are outside the - ;; scope of the let-binding and thus use the wrong namespace. - ;; Ideally, we'd like to hardcode the namespace into filename. - ;; There's work in progress towards enabling that in bug#59797. - (let ((tramp-kubernetes-namespace k8sns)) - (dired (concat "/kubernetes:" pod ":")))) + (let ((ns (when k8sns (concat "%" k8sns)))) + (dired (concat "/kubernetes:" pod ns ":")))) (shell "s" "Start shell in home directory of first container of" - (let ((tramp-kubernetes-namespace k8sns) - (default-directory (concat "/kubernetes:" pod ":"))) + (let* ((ns (when k8sns (concat "%" k8sns))) + (default-directory (concat "/kubernetes:" pod ns ":"))) (shell (format "*kubed-pod-%s-shell*" pod)))) (logs "l" "Show logs for a container of" (kubed-logs pod (kubed-read-container pod "Container" t k8sns))) -- 2.39.5