From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59797: 30.0.50; [wishlist] Using namespaces in Tramp's kubernetes integration Date: Tue, 23 Jul 2024 14:59:52 +0200 Message-ID: References: <87wn78lu7n.fsf@gmx.de> <874ju96e2g.fsf@gmx.de> <87bkogr2e5.fsf@gmx.de> <87y1kaq7ty.fsf@gmx.de> <87ttggnvf5.fsf@gmx.de> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8531"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Aaron Gonzales , 59797@debbugs.gnu.org, Filipp Gunbin , Warren Lynn To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 23 15:01:32 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sWF90-000248-9u for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Jul 2024 15:01:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWF8i-0004Sy-SE; Tue, 23 Jul 2024 09:01:12 -0400 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 1sWF8U-0004Ot-Jo for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 09:01:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWF8T-0005sw-DT for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 09:00:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sWF8X-0000b5-Nl for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 09:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Jul 2024 13:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59797 X-GNU-PR-Package: emacs Original-Received: via spool by 59797-submit@debbugs.gnu.org id=B59797.17217396032096 (code B ref 59797); Tue, 23 Jul 2024 13:01:01 +0000 Original-Received: (at 59797) by debbugs.gnu.org; 23 Jul 2024 13:00:03 +0000 Original-Received: from localhost ([127.0.0.1]:59463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWF7a-0000Xe-A6 for submit@debbugs.gnu.org; Tue, 23 Jul 2024 09:00:03 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:33632 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWF7Y-0000Wm-Fu for 59797@debbugs.gnu.org; Tue, 23 Jul 2024 09:00:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1721739595; bh=ZBgwmE/4w+lniBPUCDF9kmemeNJL5b2I4kEEx56PxJk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=sCdIDnkW//XVnylZtVoRIOu9l7CFmUGoFNhV8B3+dlgjlzaFfvWjcgnilcijPm7I6 eBig+dOJifhEfmEtQ+Nk1QWmgCcPGTW8XdVXA5FDYUzn9vpYlEYrWHU3RvJNj3OlI8 xBeudlzwQMPrMqBjal5NCpjRKudD6quKWGRQTWGRmLz2ZF/nB16ZGwS1Pt9XMAX4HX 46V2AoRsgFgvUz5Qbztdz4P6/lcbtbY5DPjsOm3mPchQMQwRgfNJOBTZ5Mh2AatVGH TZN5f5pZY5YOnNs7uRW8uUpWOcoQbgl71a/wllonOU/9ConNszc/yaEYe0xeTcIKZq zQbAk204Gz0Ew== In-Reply-To: <87ttggnvf5.fsf@gmx.de> (Michael Albinus's message of "Tue, 23 Jul 2024 14:29:34 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289165 Archived-At: Michael Albinus writes: > Eshel Yaron writes: > >> Hi Michael, > > Hi Eshel, > >> Michael Albinus 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 "..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/