Skip to content

Honor DefaultHostMetadataResolverFactory in host-metadata resolver wrapper - #5940

Open
Divyansh-db wants to merge 4 commits into
mainfrom
fix-host-metadata-resolver-factory-bypass
Open

Honor DefaultHostMetadataResolverFactory in host-metadata resolver wrapper#5940
Divyansh-db wants to merge 4 commits into
mainfrom
fix-host-metadata-resolver-factory-bypass

Conversation

@Divyansh-db

Copy link
Copy Markdown
Contributor

Summary

Fixes a pre-existing bug where the provider silently ignored config.DefaultHostMetadataResolverFactory.

During provider configuration the provider installs a wrapper around the SDK's host-metadata resolver (cfg.HostMetadataResolver) so it can observe the host's workspace_id from the single /.well-known/databricks-config fetch. The SDK only consults the DefaultHostMetadataResolverFactory global when cfg.HostMetadataResolver is nil — but because the wrapper always sets cfg.HostMetadataResolver, that factory was never reached. The wrapper's own fallback went straight to the built-in HTTP fetch, so any resolver installed through the factory was silently bypassed.

Fix

The wrapper now replicates the SDK's resolver precedence when choosing what to delegate to: a pre-existing resolver, then DefaultHostMetadataResolverFactory, then the built-in HTTP fetch. It still performs exactly one metadata fetch.

Testing

Adds a regression test that installs a factory and asserts it is consulted (the config is back-filled from the factory's metadata). The test fails without the fix — the factory is called zero times and no back-fill happens — and passes with it. make fmt lint ws clean; existing configuration tests pass.

Note

This is the standalone fix for a bug that predates and is independent of the eager-workspace-id work; it is being sent separately so it can be reviewed and merged on its own.

@Divyansh-db
Divyansh-db deployed to test-trigger-is August 11, 2026 16:08 — with GitHub Actions Active
Co-authored-by: Isaac
@Divyansh-db
Divyansh-db deployed to test-trigger-is August 11, 2026 16:08 — with GitHub Actions Active
@Divyansh-db
Divyansh-db marked this pull request as ready for review August 11, 2026 16:09
@Divyansh-db
Divyansh-db requested review from a team as code owners August 11, 2026 16:09
@Divyansh-db
Divyansh-db requested review from mihaimitrea-db and removed request for a team August 11, 2026 16:09
@Divyansh-db
Divyansh-db deployed to test-trigger-is August 11, 2026 16:09 — with GitHub Actions Active
@Divyansh-db
Divyansh-db requested review from rauchy and removed request for a team and mihaimitrea-db August 11, 2026 16:10
@Divyansh-db
Divyansh-db deployed to test-trigger-is August 11, 2026 17:44 — with GitHub Actions Active
@Divyansh-db
Divyansh-db deployed to test-trigger-is August 11, 2026 17:46 — with GitHub Actions Active
@rauchy
rauchy deployed to test-trigger-is August 11, 2026 22:00 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Unit tests

If this PR is from a fork, the tests check runs offline against a pre-warmed Go module cache because fork PRs cannot authenticate to the internal Go module proxy.

If this PR changes go.mod or go.sum, the tests check will fail until a maintainer warms the cache for it:

Actions -> Warm Go Cache -> Run workflow -> pr_number = 5940

Re-run the failed check once the cache warming completes.

Integration tests

Integration tests don't run automatically for external contributors; an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 5940
  • Commit SHA: 65d99547961aeb9d929516a8f3acd201f9dba3ce

Checks will be approved automatically on success.

@rauchy
rauchy deployed to test-trigger-is August 11, 2026 22:02 — with GitHub Actions Active
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.

2 participants