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).

@github-code-quality

github-code-quality Bot commented Jul 3, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: Go

Go / code-coverage/go

The overall coverage in commit 3d0f44a in the feat/dvp-provider-co... branch remains at 24%, unchanged from commit 820cdf3 in the main branch.

Show a code coverage summary of the most impacted files.
File main 820cdf3 feat/dvp-provider-co... 3d0f44a +/-
internal/provis.../dvp/connect.go 13% 13% 0%
pkg/cluster/cluster.go 0% 0% 0%
internal/provis...dvp/provider.go 52% 54% +2%
internal/provis...dvp/masterip.go 0% 39% +39%

Updated July 21, 2026 04:45 UTC

@duckhawk
duckhawk force-pushed the feat/dvp-provider-connect branch 2 times, most recently from a2dea3d to 60e9734 Compare July 21, 2026 01:59
…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.

Signed-off-by: v.oleynikov <vasily.oleynikov@flant.com>
@duckhawk
duckhawk force-pushed the feat/dvp-provider-connect branch from 60e9734 to 3d0f44a Compare July 21, 2026 04:44
@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 56%
github.com/deckhouse/storage-e2e/internal/infrastructure/ssh 0%
github.com/deckhouse/storage-e2e/internal/infrastructure/ssh/v2 80%
github.com/deckhouse/storage-e2e/internal/kubernetes/clusterlock 75%
github.com/deckhouse/storage-e2e/internal/kubernetes/commander 53%
github.com/deckhouse/storage-e2e/internal/kubernetes/deckhouse 0%
github.com/deckhouse/storage-e2e/internal/kubernetes/kubeaccess 78%
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 53%
github.com/deckhouse/storage-e2e/internal/provisioning/commander 16%
github.com/deckhouse/storage-e2e/internal/provisioning/dvp 63%
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/commander 0%
github.com/deckhouse/storage-e2e/pkg/e2e 42%
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 24% (3764 / 15777)

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