]> git.eshelyaron.com Git - emacs.git/commitdiff
(kubed-pods-{dired,shell}): Use new Tramp file name syntax
authorEshel Yaron <me@eshelyaron.com>
Thu, 25 Jul 2024 12:10:13 +0000 (14:10 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 25 Jul 2024 12:10:13 +0000 (14:10 +0200)
lisp/net/kubed.el

index 2eae4de23fdd8ff77e9006cce6bd7d1190758f47..1d2a206c566da4cdeb62031617d0e2f679147790 100644 (file)
@@ -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)))