Minor v2 connection layer improvements to help with k0sctl migration#302
Minor v2 connection layer improvements to help with k0sctl migration#302
Conversation
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the connection model to expose (a) a protocol “family” vs “implementation” name and (b) a standardized connection liveness check, primarily to support migration scenarios where the SSH implementation choice matters.
Changes:
- Extend
protocol.ConnectionwithProtocolName()andIsConnected()and surface them viarig.Client. - Implement the new interface methods across SSH/OpenSSH/WinRM/localhost and the test mock connection.
- Improve OpenSSH host-key failure classification (mark as non-retryable) and add client tests for reconnect + protocol naming.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
protocol/connection.go |
Expands the core connection interface with protocol naming and liveness. |
client.go |
Adds Client.IsConnected() and Client.ProtocolName() wrappers. |
protocol/ssh/connection.go |
Adds ProtocolName() for native SSH. |
protocol/openssh/connection.go |
Splits protocol family/name, adds liveness probing, and improves host-key error handling. |
protocol/winrm/connection.go |
Adds ProtocolName() and a probe-based IsConnected(). |
protocol/localhost/connection.go |
Adds ProtocolName() and IsConnected() (always true). |
rigtest/mockrunner.go |
Updates mock connection to support connect/disconnect state and new interface methods. |
client_test.go |
Adds tests for reconnect behavior and protocol naming. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The v2 API is not released and not in use yet so breaking it is not a problem. Making some final last mile changes to make it easier to make k0sctl use rig v2.