Eshel Yaron <[email protected]> writes: Hi Eshel,
> Hmm, but this does not specify the first host, and that is the what > actually determines the login-program in our case, not the kube-hostname > that we're connecting to. > We want "/ssh:[email protected]|kubedv2:kubed-hostname:/some/file" to use > a different kubectl (on example.com) than the one we use (locally) for > "/kubedv2:kube-hostname:/some/file" or via another first hop, and we > want Tramp to use that different kubectl for all kubedv2 connection that > follow a "/ssh:[email protected]" hop, not just to a specific kube-hostname. > Hope that makes it clearer. I see. What about extending tramp-connection-properties to use also a function as property value? Something like --8<---------------cut here---------------start------------->8--- (add-to-list 'tramp-connection-properties (list "^/kubedv2:kube-hostname:" "login-program" #'my-kubectl-function)) --8<---------------cut here---------------end--------------->8--- The regexp is always applied to the hop name, that is it is applied in both "/ssh:[email protected]|kubedv2:kubed-hostname:/some/file" and "/kubedv2:kube-hostname:/some/file" cases. my-kubectl-function could return a proper string based on some calculations over default-directory or whatever, don't know. > Thanks, > > Eshel Best regards, Michael.
