Skip to content

Commit c8f42ce

Browse files
denikclaude
andauthored
Remove unused configRoot parameter from DeploymentBundle.Apply (#4673)
## Why It must not be used, all actions must be performed based on plan, not config. Needed for "bundle deploy --plan" to work reliably (#4134). Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6357294 commit c8f42ce

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

bundle/direct/bundle_apply.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"errors"
77
"fmt"
88

9-
"github.com/databricks/cli/bundle/config"
109
"github.com/databricks/cli/bundle/deployplan"
1110
"github.com/databricks/cli/libs/logdiag"
1211
"github.com/databricks/cli/libs/structs/structaccess"
@@ -16,7 +15,7 @@ import (
1615

1716
type MigrateMode bool
1817

19-
func (b *DeploymentBundle) Apply(ctx context.Context, client *databricks.WorkspaceClient, configRoot *config.Root, plan *deployplan.Plan, migrateMode MigrateMode) {
18+
func (b *DeploymentBundle) Apply(ctx context.Context, client *databricks.WorkspaceClient, plan *deployplan.Plan, migrateMode MigrateMode) {
2019
if plan == nil {
2120
panic("Planning is not done")
2221
}

bundle/phases/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func deployCore(ctx context.Context, b *bundle.Bundle, plan *deployplan.Plan, ta
103103
cmdio.LogString(ctx, "Deploying resources...")
104104

105105
if targetEngine.IsDirect() {
106-
b.DeploymentBundle.Apply(ctx, b.WorkspaceClient(), &b.Config, plan, direct.MigrateMode(false))
106+
b.DeploymentBundle.Apply(ctx, b.WorkspaceClient(), plan, direct.MigrateMode(false))
107107
} else {
108108
bundle.ApplyContext(ctx, b, terraform.Apply())
109109
}

bundle/phases/destroy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func approvalForDestroy(ctx context.Context, b *bundle.Bundle, plan *deployplan.
9696

9797
func destroyCore(ctx context.Context, b *bundle.Bundle, plan *deployplan.Plan, engine engine.EngineType) {
9898
if engine.IsDirect() {
99-
b.DeploymentBundle.Apply(ctx, b.WorkspaceClient(), &b.Config, plan, direct.MigrateMode(false))
99+
b.DeploymentBundle.Apply(ctx, b.WorkspaceClient(), plan, direct.MigrateMode(false))
100100
} else {
101101
// Core destructive mutators for destroy. These require informed user consent.
102102
bundle.ApplyContext(ctx, b, terraform.Apply())

bundle/statemgmt/upload_state_for_yaml_sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (m *uploadStateForYamlSync) convertState(ctx context.Context, b *bundle.Bun
176176
}
177177
}
178178

179-
deploymentBundle.Apply(ctx, b.WorkspaceClient(), &uninterpolatedConfig, plan, direct.MigrateMode(true))
179+
deploymentBundle.Apply(ctx, b.WorkspaceClient(), plan, direct.MigrateMode(true))
180180

181181
return diags
182182
}

cmd/bundle/deployment/migrate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ To start using direct engine, deploy with DATABRICKS_BUNDLE_ENGINE=direct env va
262262
}
263263
}
264264

265-
deploymentBundle.Apply(ctx, b.WorkspaceClient(), &b.Config, plan, direct.MigrateMode(true))
265+
deploymentBundle.Apply(ctx, b.WorkspaceClient(), plan, direct.MigrateMode(true))
266266
if logdiag.HasError(ctx) {
267267
logdiag.LogError(ctx, errors.New("migration failed; ensure you have done full deploy before the migration"))
268268
return root.ErrAlreadyPrinted

0 commit comments

Comments
 (0)