Skip to content

Minor v2 connection layer improvements to help with k0sctl migration#302

Merged
kke merged 9 commits intomainfrom
protocol-connection-layer
Mar 25, 2026
Merged

Minor v2 connection layer improvements to help with k0sctl migration#302
kke merged 9 commits intomainfrom
protocol-connection-layer

Conversation

@kke
Copy link
Copy Markdown
Contributor

@kke kke commented Mar 25, 2026

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.

Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Connection with ProtocolName() and IsConnected() and surface them via rig.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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@kke kke changed the title Minor improvements to help with k0sctl migration Minor improvements and fixes to help with k0sctl rig v2 migration Mar 25, 2026
@kke kke changed the title Minor improvements and fixes to help with k0sctl rig v2 migration Minor v2 connection layer improvements to help with k0sctl migration Mar 25, 2026
@kke kke requested a review from Copilot March 25, 2026 12:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kke kke marked this pull request as ready for review March 25, 2026 14:40
@kke kke merged commit 5cc49c4 into main Mar 25, 2026
15 checks passed
@kke kke deleted the protocol-connection-layer branch March 25, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants