Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions cmd/bundle/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ See https://docs.databricks.com/en/dev-tools/bundles/index.html for more informa
b.Config.Bundle.Deployment.Lock.Force = forceLock
b.AutoApprove = autoApprove

if cmd.Flag("compute-id").Changed {
b.Config.Bundle.ClusterId = clusterId
}

if cmd.Flag("cluster-id").Changed {
if cmd.Flag("compute-id").Changed || cmd.Flag("cluster-id").Changed {
b.Config.Bundle.ClusterId = clusterId
}
if cmd.Flag("fail-on-active-runs").Changed {
Expand Down
15 changes: 4 additions & 11 deletions cmd/bundle/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,11 @@ It is useful for previewing changes before running 'bundle deploy'.`,
PreDeployChecks: true,
}

// Only add InitFunc if we need to set force or cluster ID
if force || cmd.Flag("compute-id").Changed || cmd.Flag("cluster-id").Changed {
opts.InitFunc = func(b *bundle.Bundle) {
b.Config.Bundle.Force = force
opts.InitFunc = func(b *bundle.Bundle) {
b.Config.Bundle.Force = force

if cmd.Flag("compute-id").Changed {
b.Config.Bundle.ClusterId = clusterId
}

if cmd.Flag("cluster-id").Changed {
b.Config.Bundle.ClusterId = clusterId
}
if cmd.Flag("compute-id").Changed || cmd.Flag("cluster-id").Changed {
b.Config.Bundle.ClusterId = clusterId
}
}

Expand Down
Loading