Subject: bug#59797: 30.0.50; [wishlist] Using namespaces in Tramp's kubernetes integration

From: Eshel Yaron <[email-masked]>
Date: Wed, 24 Jul 2024 19:30:29 +0200

Hi Michael,

Michael Albinus <[email-masked]> writes:

> I gave it a first try. It turns out, that "+" is a bad choice, because
> it doesn't belong to tramp-host-regexp. I would need to rewrite host
> name handling in Tramp just for that, which is not desirable.
>
> tramp-host-regexp is "[%._[:alnum:]-]+". So we could take either "%" or
> "_" as namespace delimiter. I've decided for "%"; a complete remote file
> name for kubernetes is now "/kubernetes:[CONTAINER.]POD[%NAMESPACE]:/path/to/file".

Makes sense.  Thank you for tackling it so promptly!

> It works OK acc to my basic tests. I have appended the patch; I would
> really appreciate if you could give it more testing in your production
> environment. Please sync first with the Emacs or Tramp git repo; this
> morning I've pushed other changes there.

>From a quick test, this mostly works fine.  There's one issue (typo?) in
tramp-kubernetes--namespace that causes a regression when there's no
explicit namespace and tramp-kubernetes-namespace is nil, it returns an
empty string instead of nil.

> What's left is file name completion for namespaces. I'm undecided
> whether we need this in practice; let's see how it goes as-it-is.

It's not very crucial for me, FWIW.

Cheers,

Eshel