unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Aaron Gonzales <aarongonzales1@gmail.com>,
	59797@debbugs.gnu.org, Filipp Gunbin <fgunbin@fastmail.fm>,
	Warren Lynn <wrn.lynn@gmail.com>
Subject: bug#59797: 30.0.50; [wishlist] Using namespaces in Tramp's kubernetes integration
Date: Tue, 23 Jul 2024 14:59:52 +0200	[thread overview]
Message-ID: <m15xsw6z7b.fsf@eshelyaron.com> (raw)
In-Reply-To: <87ttggnvf5.fsf@gmx.de> (Michael Albinus's message of "Tue, 23 Jul 2024 14:29:34 +0200")

Michael Albinus <michael.albinus@gmx.de> writes:

> Eshel Yaron <me@eshelyaron.com> writes:
>
>> Hi Michael,
>
> Hi Eshel,
>
>> Michael Albinus <michael.albinus@gmx.de> writes:
>>
>>> Now we have kubernetes integrated in Tramp. We can access pods like
>>> "/kubernetes:POD:/path/to/file".
>>>
>>> However, kubernetes can much more. For all services (like pods) it
>>> creates DNS entries "<service-name>.<namespace-name>.svc.cluster.local".
>>> Should'nt we support this? It means should we allow to access kubernetes
>>> pods like "/kubernetes:POD.NAMESPACE:/path/to/file", including
>>> completion for namespace names?
>>
>> [...]
>>
>>> Finally, I've taken the stab and implemented something along these
>>> lines. It is a little bit different from earlier proposals.
>>>
>>> - You can now specify a container in the host name, dotted notation.
>>>   "/kubernetes:container.pod:" accesses the given container. If it is
>>>   not specified, as in "/kubernetes:pod:", the first container is taken.
>>>
>>> - You can now specify different context and namespace. Change the new
>>>   user options tramp-kubernetes-context or tramp-kubernetes-namespace
>>>   for this effect.
>>>
>>> Everything pushed to the Emacs and Tramp master repositories. The target
>>> is now Tramp 2.7 / Emacs 30. Comments welcome :-)
>>
>> Sorry for not chiming in when this discussion was still ongoing, and
>> thank you for your work on the Kubernetes integration.  I use it a lot.
>>
>> Would it be possible the reconsider adding an optional namespace to
>> Tramp's Kubernetes file name syntax?  I'm thinking of something like
>> "/kubernetes:[CONTAINER.]POD[.NAMESPACE]:/...".
>
> Possible. However, the syntax is ambiguous. If we have "/kubernetes:name1.name2:/..."
> it isn't clear what they are. name1 could be a container, and name2 a pod. Or
> name1 is a pod, and name2 is a namespace. Could we agree on another
> delimiter between POD and NAMESPACE?

You're absolutely right.  AFAIU from the Kubernetes documentation[0],
non-alphanumeric characters other than "-" and "." should be safe.
Maybe "@" would be the most natural choice?  "+" could work too I think.

>> My use case is that I want to start Dired for a (container in a) pod in
>> another namespace.  I can almost get there if I temporarily bind
>> tramp-kubernetes-namespace around the call to dired, but the binding
>> doesn't carry on to subsequent operations in the Dired buffer.  So an
>> explicit namespace in default-directory could help, I think.
>
> I see, it makes sense. My practical kubernetes experience is sparse; I
> would exploit you while implementing. At least for tests.

SGTM.

> Note also, that Emacs 30 is in pretest. Any such feature change will be
> targeted to Emacs 31 / Tramp 2.8.

Of course, that's fine.

Thank you!


[0] https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
    https://kubernetes.io/docs/concepts/overview/working-with-objects/names/





  reply	other threads:[~2024-07-23 12:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-03  9:20 bug#59797: 30.0.50; [wishlist] Using namespaces in Tramp's kubernetes integration Michael Albinus
2022-12-05 14:05 ` Filipp Gunbin
2022-12-05 15:54   ` Michael Albinus
2022-12-06 13:56     ` Filipp Gunbin
2022-12-06 15:13       ` Michael Albinus
2023-06-23 19:47         ` Michael Albinus
2023-07-02  8:37           ` Michael Albinus
     [not found]           ` <m1cyn4cq38.fsf@eshelyaron.com>
2024-07-23 12:29             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-23 12:59               ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-07-23 14:13                 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-24 16:48                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-24 17:30                     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-25  8:20                       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-25 10:48                         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-25 11:42                           ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m15xsw6z7b.fsf@eshelyaron.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59797@debbugs.gnu.org \
    --cc=aarongonzales1@gmail.com \
    --cc=fgunbin@fastmail.fm \
    --cc=me@eshelyaron.com \
    --cc=michael.albinus@gmx.de \
    --cc=wrn.lynn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).