emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature to allow selection of container when connecting to kubernete


From: Michael Albinus
Subject: Re: Feature to allow selection of container when connecting to kubernetes pod
Date: Sat, 31 Dec 2022 11:22:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]