From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Feature to allow selection of container when connecting to kubernetes pod Date: Sat, 31 Dec 2022 11:22:51 +0100 Message-ID: <87h6xbg9dw.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37758"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org, Filipp Gunbin To: Aaron Gonzales Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 31 11:23:55 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pBZ1t-0009e5-UA for ged-emacs-devel@m.gmane-mx.org; Sat, 31 Dec 2022 11:23:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pBZ1A-0007Yu-BY; Sat, 31 Dec 2022 05:23:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBZ13-0007V9-JA for emacs-devel@gnu.org; Sat, 31 Dec 2022 05:23:04 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBZ11-0003Gl-2F for emacs-devel@gnu.org; Sat, 31 Dec 2022 05:23:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1672482172; bh=EmZytrw5R9ITuXlrnn29fzeYNWbrskuMQKbbcLMrUrY=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=AXDawRMOIaodeWGC/OraZ6s9wpf2JELZ8PgSbatsKIIbupzKLlmH5rsTOdFsr5wQ7 2A30vCgVxbRwSf9yV7fpSHLscwdK4dWvcXTisF7xIBlkKtftHYd0OpZYM8HVR9gG0c 4kFJngWKwI6I3W5tvab+256s5fT4SP5ou4UZIf6faKq1uVnSYePIbGEsqIh3ykkc7o Jb1uLX6XWYUGaXYjpPzxUVh8lqqQPXR5OHF0LRGYN25nwz88H6cCQkf+xrNrYuM7sM t6NlxwmarzhrpBhEEAa3amDq0N+jmNraaUF46iWQaprR0x2PPjzGN6wKcMQmhtr5kF Po1F6pYpd5/rA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.37.45]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MybGX-1otLjV1R1x-00ywy0; Sat, 31 Dec 2022 11:22:52 +0100 In-Reply-To: (Aaron Gonzales's message of "Fri, 30 Dec 2022 05:53:45 -0800") X-Provags-ID: V03:K1:2h1noumANgqXRWqVHJM/VZrRWSa/LT5/JiCgn2g9LQ77xvkSj+L C8UBtMZQ204laxVkqT0nWIjdwscyRQDl+VSo23pPjlTyPWRkrmKAu2QaNKtdPUKzNjmvV9p mvb30ShzCxsJj+wwWCiqJoojBbfFLtxT4RLR42Qf8B5rpP8nwdsm8K5NP0lnpx+fHrhaIjp 85YvuvX906M3dfgGQIdAQ== UI-OutboundReport: notjunk:1;M01:P0:r2SQoDx3CnU=;F3VpK03/6PnsR0S8vSBF2M3faDZ lEgjjmFMvfYYLT0teCXTIj7eY/ZiUqVNkLxZoXdZOi939noY8lqNHJekfteJp1UhRN4y/YqPK NM1JPxNX3j4OFQRcZwjr8nkHIpgZWof/cmX9joo+FE7dJFPAIkP7MlGSjrLcPWVMfXvnXzCcW zx3odMu6Tt7LY8gBC2es5zewLJN93C4pbMWIxhcCuAcy+p8DC23JYhDOlJ+u4i+2jZQfNAoGI 5JVwPc7grr28R6coI5EnAK2FLoaASGbkC1ajzpYsu8MloAbCKAk6mw8uP6Z2IXerbEbNiY9QB Y+6SQIGAI5Iszr9+ICkZx7fcFjOnmH+6wlTDJwzcMmEdP5WVNaa79GgDXjM6xvgR8XdpGXxAG jdDO7B00QXmqbp7fB51rdPaQ4eCQkzBhZpqQJpwYSJJfXWsiP4iRVI/iJ3SAQKeuIqtUx2OpI nQufbpbCaoJ51xeqyrq5fjp/sEinTPCGXJjcD0VayeOU6KqLl/rj1mKz3CbHMDxiJlbMY1e9O bPCOwkk5EytrHVQKrcSD+FHU6580oQBi9JgqnGS0AvUJOfJtIZJJnK3jTWGe6BharsNhqhTIw ijhBJcBP+kVm3vGVe8rMXAh5jXGUSaGEgn0j0nQMbiMkgB5vmQi7fRVh873gZ4zc6t5Hma5je iJDTxTI+5cLSjiEl4L/Z54UDCppY7BJTn8vLYQY5kPeHMGXEBBt7hBAjkH9Ib5K6B6BpiSUFk Gc1A97n+WDhC15lKv6Icd2aaA8nG7B8L3WcnQlGuYiV+cYXk4ZQEIRBXjxaNCZ5VZZBCGjtR Received-SPF: pass client-ip=212.227.17.22; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302156 Archived-At: Aaron Gonzales 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 repor= t 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.