Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reconnect ssh to reload changes after updating environment file (#649)
* bug: reconnect ssh upon environment change This is a workaround. UpdateEnvironment on rig's os/linux.go writes the environment to /etc/environment and then exports the same variables using 'export' command. Unfortunately this is not enough for the environment to be preserved across multiple ssh sessions. We need to write the environment and then reopen the ssh connection. Go's ssh client.Setenv() depends on ssh server configuration (sshd only accepts LC_* variables by default). This problem happens, for example, when we need to deploy k0s behing a proxy. We set the necessary environment variables in k0sctl.yaml but the command fails when attempting to use `apt` to install `curl`. As `HTTP_PROXY`, and any other variable, are not set when we run the apt command it fail as it can't reach the remote servers. Signed-off-by: Ricardo Maraschini <[email protected]> * chore: add retry logic to reconnection * chore: logging before the disconnection --------- Signed-off-by: Ricardo Maraschini <[email protected]>
- Loading branch information