From: Eshel Yaron Date: Thu, 25 Jul 2024 12:10:13 +0000 (+0200) Subject: (kubed-pods-{dired,shell}): Use new Tramp file name syntax X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e76bd5a2aa9b26bcb9cdbf196ad7ccc38f241d75;p=emacs.git (kubed-pods-{dired,shell}): Use new Tramp file name syntax --- 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)))