Skip to content

feat(dvp): implement Provider.Connect + ConnectBase for suite attach#44

Open
duckhawk wants to merge 1 commit into
mainfrom
feat/dvp-provider-connect
Open

feat(dvp): implement Provider.Connect + ConnectBase for suite attach#44
duckhawk wants to merge 1 commit into
mainfrom
feat/dvp-provider-connect

Conversation

@duckhawk

@duckhawk duckhawk commented Jul 3, 2026

Copy link
Copy Markdown
Member

What this does

Makes the dvp provider usable in the split bootstrap → run-tests model, the same way commander already is.

The dvp provider's Bootstrap already brings a nested cluster up end-to-end (provision VMs → dhctl bootstrap → join nodes → enable modules), but it did not implement the Connector contract. In CI the run-tests process is separate from the one that ran cmd/bootstrap-cluster, so without Connect the suite had no provider-driven way to reach the cluster and fell back to the legacy TEST_CLUSTER_CREATE_MODE path.

Changes

  • dvpProvider.Connect (clusterprovider.Connector): read the first master hostname from the static cluster_config, resolve the running master VM's internal IP off the base cluster's virtualization API (new defaultMasterResolver / firstMasterHostname), then reuse connectToMaster (SSH kubeconfig fetch + API tunnel). cluster.connectViaProvider now drives the suite connect through dvp exactly like commander.
  • dvpProvider.ConnectBase + new optional clusterprovider.BaseConnector: expose the DVP base cluster kubeconfig so suites that manipulate the VirtualDisks backing node disks (e.g. sds-node-configurator) can reach it via TestClusterResources.BaseKubeconfig. connectViaProvider sets BaseKubeconfig and chains the base teardown into the standard cleanup path. No-op for providers that don't implement it (commander).
  • .github/workflows/e2e.yml: add a dvp-gated Configure DVP connection step to run-tests that emits the provider connect env (mirrors the commander step).

Tests

  • New unit tests for the Connect wiring: happy path (call ordering: base connect → resolve → base cleanup → connectToMaster), resolve error (base released, connectToMaster not called), and firstMasterHostname.
  • go build ./... and go test for internal/provisioning/dvp/..., pkg/clusterprovider/..., pkg/cluster/... pass.

Not covered here

End-to-end validation on a live DVP cluster (node-SSH topology, base-kubeconfig tunnel longevity for a full suite run) — to be exercised by the first consumer, sds-node-configurator (deckhouse/sds-node-configurator PR that adopts cluster_provider: dvp).

…through the dvp provider

The dvp provider Bootstrap already brings a nested cluster up end-to-end
(provision VMs -> dhctl bootstrap -> join nodes -> enable modules), but it did
not implement the Connector contract. In the split bootstrap/run-tests model the
run-tests process is separate from the one that ran Bootstrap, so without Connect
the suite had no provider-driven way to reach the cluster.

- Connect (clusterprovider.Connector): read the first master hostname from the
  static cluster_config, resolve the running master VM's internal IP off the base
  cluster's virtualization API (new defaultMasterResolver / firstMasterHostname),
  then reuse connectToMaster (SSH kubeconfig fetch + API tunnel). cluster.connect-
  ViaProvider now drives the suite connect through dvp just like commander.
- ConnectBase (new optional clusterprovider.BaseConnector): expose the DVP base
  cluster kubeconfig so suites that manipulate the VirtualDisks backing node disks
  (e.g. sds-node-configurator) can reach it via TestClusterResources.BaseKubeconfig.
  connectViaProvider sets BaseKubeconfig and chains the base teardown into the
  standard cleanup path.
- e2e.yml: add a dvp-gated "Configure DVP connection" step to run-tests that emits
  the provider connect env (mirrors the commander step).

Unit tests cover Connect wiring (happy path, resolve error, master-hostname
lookup). go build ./... and go test for the affected packages pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Go

Go / code-coverage/go

The overall coverage in the branch remains at 21%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File 00cf3a6 5d76971 +/-
pkg/cluster/cluster.go 0% 0% 0%
internal/provis...dvp/provider.go 53% 54% +1%
internal/infras...sh/v2/tunnel.go 83% 87% +4%
internal/provis...dvp/masterip.go 0% 39% +39%

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

@github-actions

github-actions Bot commented Jul 3, 2026

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 56%
github.com/deckhouse/storage-e2e/internal/infrastructure/ssh 0%
github.com/deckhouse/storage-e2e/internal/infrastructure/ssh/v2 81%
github.com/deckhouse/storage-e2e/internal/kubernetes/commander 49%
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/commander 14%
github.com/deckhouse/storage-e2e/internal/provisioning/dvp 62%
github.com/deckhouse/storage-e2e/internal/provisioning/dvp/vm 78%
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 5%
Summary 21% (3202 / 14956)

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