Skip to content

Introduce self-healing SSH client with connection management#27

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

Introduce self-healing SSH client with connection management#27
fastrapier wants to merge 10 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.

@github-code-quality

github-code-quality Bot commented Jun 22, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: Go

Go / code-coverage/go

The overall coverage in the branch is 12%. The coverage in the branch is 9%.

Show a code coverage summary of the most impacted files.
File 734b87d 17b5a2a +/-
internal/provis...g/dvp/config.go 64% 0% -64%
pkg/kubernetes/modules.go 20% 20% 0%
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% 59% +59%
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%

Updated June 26, 2026 09:40 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@fastrapier fastrapier force-pushed the feat/new-ssh-client branch from 2470d73 to 94fd6b0 Compare June 24, 2026 15:23
…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.studenikin@flant.ru>
… logic

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

This commit renames the Tunnel method to OpenTunnel in the SSH client implementation and updates all related references in the codebase, including tests and configuration files. Additionally, it improves the configuration structure by renaming environment variable keys for clarity.

Signed-off-by: Daniil Studenikin <daniil.studenikin@flant.ru>
@fastrapier fastrapier force-pushed the feat/new-ssh-client branch from 94fd6b0 to 5775165 Compare June 26, 2026 07:14
@fastrapier fastrapier added the e2e/run Label to run e2e pipeline label Jun 26, 2026
Signed-off-by: Daniil Studenikin <daniil.studenikin@flant.ru>
… method

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

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

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

Signed-off-by: Daniil Studenikin <daniil.studenikin@flant.ru>
@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 45%
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 48%
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 52%
github.com/deckhouse/storage-e2e/internal/provisioning/dvp 0%
github.com/deckhouse/storage-e2e/pkg/cluster 4%
github.com/deckhouse/storage-e2e/pkg/clusterprovider 89%
github.com/deckhouse/storage-e2e/pkg/clusterprovider/registry 100%
github.com/deckhouse/storage-e2e/pkg/kubernetes 5%
github.com/deckhouse/storage-e2e/pkg/retry 94%
github.com/deckhouse/storage-e2e/pkg/storage-e2e 0%
github.com/deckhouse/storage-e2e/pkg/testkit 4%
Summary 12% (1551 / 12933)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e/run Label to run e2e pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant