unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Aaron Gonzales <aarongonzales1@gmail.com>
Cc: emacs-devel@gnu.org, Filipp Gunbin <fgunbin@fastmail.fm>
Subject: Re: Feature to allow selection of container when connecting to kubernetes pod
Date: Sat, 31 Dec 2022 11:22:51 +0100	[thread overview]
Message-ID: <87h6xbg9dw.fsf@gmx.de> (raw)
In-Reply-To: <CAB3ao9z7nMURAKHdSs6Nhoscn_99UJ3FkXviC-9YNfC2uhe67w@mail.gmail.com> (Aaron Gonzales's message of "Fri, 30 Dec 2022 05:53:45 -0800")

Aaron Gonzales <aarongonzales1@gmail.com> writes:

> Hi all,

Hi Aaron,

> This is my first time doing this so sorry if there are some mistakes
> in the process. I am also not entirely accustomed to elisp so please
> forgive my code and provide any feedback you may have.

Thanks for your contribution. If you propose a change in Emacs which
would require more discussion, the recommended way is to write a bug report
via 'M-x report-emacs-bug'. Further discussion will happen then there,
which is also good for the archives. Feature proposals are also
discussed this way. Please write such a report.

Since I have only rudimentary knowledge about kubernetes (to say the
best), I Cc Filipp Gunbin who has brought kubernetes to Tramp.

> These new changes allow the user to select a container when connecting
> to a kubernetes pod. This is essential for kubernetes Tramp
> functionality since the first container may not always be the desired
> pod. Many pods contain multiple side-car containers besides the main
> application container.

Sounds useful to me.

> Now considering the above, the below changes are not the most
> desirable from my perspective. From a user perspective, there are no
> visual cues to display what container you selected. I wanted to avoid
> using ":" separator between a pod and container since that might
> overload the meaning of that separator.

Hmm, yes. And your patch has also other disadvantages. After a rough
reading, it looks to me like you can specify the container only
interactively, when reading a file name. But this is not the only way to
invoke Tramp, you could always say in your Lisp code

  (copy-file "/kubernetes:pod:/path/to/file" "/another/local/path/")

No user action expected.

Therefore, I recommend to extend the syntax. The selected container shall
be part of the pod name, like "/kubernetes:pod%container:/path/to/file"
or "/kubernetes:pod[container]:/path/to/file". The container part is
optional, of course. And I'm also open for another syntax.

> The other issue is the change to tramp-expand-args which now can
> expect either a lambda or string. The lambda takes in the entire
> tramp-file-name struct but that can be reduced to just passing the pod
> name for the sake of kubernetes connections. At the very least this
> should warrant a function rename, but I could also see a possible
> break off to more specific handling for kubernetes.

With the extended pod name syntax, we don't need this anymore. The
container name selection could be handled in
tramp-kubernetes--completion-function.

> Currently, Emacs is only accounting for connecting to pods, but jobs
> are still relevant when it comes to kubernetes which would require
> some selection.

Yes, but pls let discuss this in another thread (bug report). Note that
there is also the proposal to support different namespaces, see bug#59797.

Best regards, Michael.



  reply	other threads:[~2022-12-31 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30 13:53 Feature to allow selection of container when connecting to kubernetes pod Aaron Gonzales
2022-12-31 10:22 ` Michael Albinus [this message]
2023-01-03  1:14   ` Filipp Gunbin
  -- strict thread matches above, loose matches on Subject: below --
2022-12-30 20:58 Aaron Gonzales

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=87h6xbg9dw.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=aarongonzales1@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=fgunbin@fastmail.fm \
    /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).