Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Deployment complete!
Detected changes in 1 resource(s):

Resource: resources.jobs.my_job
email_notifications.on_failure: replace
email_notifications.on_failure[0]: replace
max_concurrent_runs: replace
tags['env']: remove
Expand Down
10 changes: 5 additions & 5 deletions bundle/direct/bundle_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (b *DeploymentBundle) CalculatePlan(ctx context.Context, client *databricks
}
}

entry.Changes, err = prepareChanges(ctx, adapter, localDiff, remoteDiff, savedState, remoteState != nil)
entry.Changes, err = prepareChanges(ctx, adapter, localDiff, remoteDiff, savedState, remoteStateComparable)
if err != nil {
logdiag.LogError(ctx, fmt.Errorf("%s: %w", errorPrefix, err))
return false
Expand Down Expand Up @@ -316,17 +316,17 @@ func getMaxAction(m map[string]*deployplan.ChangeDesc) deployplan.ActionType {
return result
}

func prepareChanges(ctx context.Context, adapter *dresources.Adapter, localDiff, remoteDiff []structdiff.Change, oldState any, hasRemote bool) (deployplan.Changes, error) {
func prepareChanges(ctx context.Context, adapter *dresources.Adapter, localDiff, remoteDiff []structdiff.Change, oldState, remoteState any) (deployplan.Changes, error) {
m := make(deployplan.Changes)

for _, ch := range localDiff {
e := deployplan.ChangeDesc{
Old: ch.Old,
New: ch.New,
}
if hasRemote {
// by default, assume e.Remote is the same as config; if not the case it'll be ovewritten below
e.Remote = ch.New
if remoteState != nil {
// We cannot assume e.Remote is the same as config: if the whole struct is missing, there might be diff entry for parent
e.Remote, _ = structaccess.Get(remoteState, ch.Path)
}
m[ch.Path.String()] = &e
}
Expand Down