Eshel Yaron <[email protected]> writes:

> Hi,

Hi Eshel,

>> All parameters specified by tramp-methods can be overwritten by
>> connection properties, see (info "(tramp) Predefined connection information")
>>
>> In your case, you could do (untested)
>>
>> (add-to-list 'tramp-connection-properties
>>               (list "^/kubedv2:user@example\\.com:")
>>                     "login-program" "/another/kubectl"))
>
> Thanks.  I'm not sure it applies to my use case, but perhaps I'm missing
> something:
>
> IIUC, tramp-connection-properties lets users override the login-program
> used for the first hop, whereas we need to allow the login-program of
> the second hop to depend on the first.  Namely, considering a file name
> such as "/ssh:[email protected]|kubedv2:...:/some/file", we want Tramp to
> use the connection-local value of kubed-kubectl-program in
> "/ssh:[email protected]:" as the login-program for the second hop.
>
> So far I couldn't find a way to do that with
> tramp-connection-properties, did I miss anything?
>
> FWIW I tried:
>
>   (add-to-list 'tramp-connection-properties
>                (list "example.com.*kubedv2" "login-program" 
> "/another/kubectl"))
>
> This would be more cumbersome than reusing the connection-local value of
> kubed-kubectl-program, but it would be a step in the right direction.
> Unfortunately, that didn't seem to work, I think because the previous
> hop isn't included in the string that is matched against the regexp.

Your setting apply. You need to set this for the second hop.

You didn't say what's the hop name in your example, so I've guessed
it. Try the setting

--8<---------------cut here---------------start------------->8---
(add-to-list 'tramp-connection-properties
             (list "^/kubedv2:kube-hostname:" "login-program" 
"/another/kubectl"))
--8<---------------cut here---------------end--------------->8---

kube-hostname must be adapted.

> Best,
>
> Eshel

Best regards, Michael.

Reply via email to