feat(dvp): implement Provider.Connect + ConnectBase for suite attach#44
Open
duckhawk wants to merge 1 commit into
Open
feat(dvp): implement Provider.Connect + ConnectBase for suite attach#44duckhawk wants to merge 1 commit into
duckhawk wants to merge 1 commit into
Conversation
…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>
4 tasks
Code Coverage OverviewLanguages: Go Go / code-coverage/goThe overall coverage in the branch remains at 21%, unchanged from the branch. Show a code coverage summary of the most impacted files.
Code Coverage is in Public Preview. Learn more and provide us with your feedback. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Bootstrapalready brings a nested cluster up end-to-end (provision VMs →dhctl bootstrap→ join nodes → enable modules), but it did not implement theConnectorcontract. In CI the run-tests process is separate from the one that rancmd/bootstrap-cluster, so withoutConnectthe suite had no provider-driven way to reach the cluster and fell back to the legacyTEST_CLUSTER_CREATE_MODEpath.Changes
dvpProvider.Connect(clusterprovider.Connector): read the first master hostname from the staticcluster_config, resolve the running master VM's internal IP off the base cluster's virtualization API (newdefaultMasterResolver/firstMasterHostname), then reuseconnectToMaster(SSH kubeconfig fetch + API tunnel).cluster.connectViaProvidernow drives the suite connect through dvp exactly like commander.dvpProvider.ConnectBase+ new optionalclusterprovider.BaseConnector: expose the DVP base cluster kubeconfig so suites that manipulate the VirtualDisks backing node disks (e.g. sds-node-configurator) can reach it viaTestClusterResources.BaseKubeconfig.connectViaProvidersetsBaseKubeconfigand 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 torun-teststhat emits the provider connect env (mirrors the commander step).Tests
Connectwiring: happy path (call ordering: base connect → resolve → base cleanup → connectToMaster), resolve error (base released,connectToMasternot called), andfirstMasterHostname.go build ./...andgo testforinternal/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).