Skip to content

Introduce self-healing SSH client with connection management#27

Open
fastrapier wants to merge 6 commits into
mainfrom
feat/new-ssh-client
Open

Introduce self-healing SSH client with connection management#27
fastrapier wants to merge 6 commits into
mainfrom
feat/new-ssh-client

Conversation

@fastrapier

Copy link
Copy Markdown
Member

This pull request introduces a new self-healing SSH client implementation in the internal/infrastructure/ssh/v2 package, alongside updates to documentation and dependencies. The new client separates connection strategy from operations, provides transparent reconnection, and is designed for extensibility and robust error handling. No existing consumers have been migrated yet; the legacy SSH client remains in place.

Key changes:

New self-healing SSH client (ssh/v2)

  • Added a new package internal/infrastructure/ssh/v2 implementing a self-healing SSH client with a clear separation between connection strategy (via Dialer and Route) and operations (currently tunneling, future support for Run/Upload). The client transparently handles reconnects, deduplicates concurrent reconnects using singleflight, and offers options for keepalive, retries, logging, and host key handling. The core logic is in client.go and conn.go, with a generic executor for reconnect-aware operations. [1] [2]

Documentation updates

  • Updated docs/ARCHITECTURE.md to describe the new ssh/v2 package, its design, API, and extension points. The documentation now distinguishes between the legacy SSH client and the new implementation, and details the responsibilities and structure of the new code. [1] [2] [3]
  • Added a new entry to docs/WORKLOG.md summarizing the introduction of the self-healing SSH client, its design, API, and test strategy.

Dependency management

  • Added golang.org/x/sync as a direct dependency in go.mod to support the use of singleflight for deduplicating concurrent reconnects.

fastrapier and others added 3 commits June 18, 2026 19:33
…d tunneling

Signed-off-by: Daniil Studenikin <daniil.studenikin@flant.ru>
…lient implementation

Signed-off-by: Daniil Studenikin <daniil.studenikin@flant.ru>
Signed-off-by: Daniil Studenikin <daniil.evgenyevich703@gmail.com>
…irect versions

Signed-off-by: Daniil Studenikin <daniil.studenikin@flant.ru>
Signed-off-by: Daniil Studenikin <daniil.studenikin@flant.ru>
… logic

Signed-off-by: Daniil Studenikin <daniil.studenikin@flant.ru>
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Go

Go / code-coverage/go

The overall coverage in the branch is 5%. The coverage in the branch is 2%.

Show a code coverage summary of the most impacted files.
File 60ef4b8 6ad749c +/-
internal/logger/logger.go 36% 39% +3%
internal/infras.../v2/endpoint.go 0% 37% +37%
internal/infras...sh/v2/dialer.go 0% 39% +39%
internal/infras...h/v2/options.go 0% 53% +53%
internal/infras...sh/v2/client.go 0% 79% +79%
internal/infras.../ssh/v2/conn.go 0% 86% +86%
internal/infras...sh/v2/tunnel.go 0% 87% +87%
internal/infras...sh/v2/errors.go 0% 100% +100%

Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Health
github.com/deckhouse/storage-e2e/internal/cluster 0%
github.com/deckhouse/storage-e2e/internal/config 15%
github.com/deckhouse/storage-e2e/internal/infrastructure/ssh 0%
github.com/deckhouse/storage-e2e/internal/infrastructure/ssh/v2 69%
github.com/deckhouse/storage-e2e/internal/kubernetes/commander 0%
github.com/deckhouse/storage-e2e/internal/kubernetes/deckhouse 0%
github.com/deckhouse/storage-e2e/internal/kubernetes/storage 0%
github.com/deckhouse/storage-e2e/internal/kubernetes/virtualization 0%
github.com/deckhouse/storage-e2e/internal/logger 51%
github.com/deckhouse/storage-e2e/internal/provisioning/dvp 7%
github.com/deckhouse/storage-e2e/pkg/cluster 0%
github.com/deckhouse/storage-e2e/pkg/clusterprovider 89%
github.com/deckhouse/storage-e2e/pkg/clusterprovider/registry 100%
github.com/deckhouse/storage-e2e/pkg/kubernetes 0%
github.com/deckhouse/storage-e2e/pkg/retry 0%
github.com/deckhouse/storage-e2e/pkg/storage-e2e 0%
github.com/deckhouse/storage-e2e/pkg/testkit 0%
Summary 5% (625 / 12984)

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.

1 participant