feat: add 'uc proxy' command to proxy a service port to a local port (#384)

Signed-off-by: Miek Gieben <miek@miek.nl>
Co-authored-by: Pasha Sviderski <me@psviderski.name>
This commit is contained in:
Miek Gieben
2026-06-02 18:56:16 +10:00
committed by GitHub
co-authored by Pasha Sviderski
parent 24b81af43c
commit 3586a32987
6 changed files with 220 additions and 1 deletions
+5
View File
@@ -65,6 +65,11 @@ func (cli *Client) Close() error {
return errors.Join(cli.conn.Close(), cli.connector.Close())
}
// Dialer returns a proxy dialer for establishing connections within the cluster if supported by the connector.
func (cli *Client) Dialer() (proxy.ContextDialer, error) {
return cli.connector.Dialer()
}
// progressOut returns an output stream for progress writer.
func (cli *Client) progressOut() *streams.Out {
return streams.NewOut(os.Stdout)
+1 -1
View File
@@ -241,7 +241,7 @@ func (cli *Client) pushImageToMachine(
machineIP := network.MachineIP(machineSubnet)
unregistryAddr := net.JoinHostPort(machineIP.String(), strconv.Itoa(constants.UnregistryPort))
dialer, err := cli.connector.Dialer()
dialer, err := cli.Dialer()
if err != nil {
return fmt.Errorf("get proxy dialer: %w", err)
}