Skip to content

Commit 3970144

Browse files
committed
handle ok
1 parent 300ab2e commit 3970144

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bundle/direct/bundle_plan.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ func (b *DeploymentBundle) CalculatePlan(ctx context.Context, client *databricks
217217
// for integers: compare 0 with actual object ID. As long as real object IDs are never 0 we're good.
218218
// Once we add non-id fields or add per-field details to "bundle plan", we must read dynamic data and deal with references as first class citizen.
219219
// This means distinguishing between 0 that are actually object ids and 0 that are there because typed struct integer cannot contain ${...} string.
220-
sv, _ := b.StructVarCache.Load(resourceKey)
220+
sv, ok := b.StructVarCache.Load(resourceKey)
221+
if !ok {
222+
logdiag.LogError(ctx, fmt.Errorf("%s: internal error: no state found for %q", errorPrefix, resourceKey))
223+
return false
224+
}
221225
localDiff, err := structdiff.GetStructDiff(savedState, sv.Value, adapter.KeyedSlices())
222226
if err != nil {
223227
logdiag.LogError(ctx, fmt.Errorf("%s: diffing local state: %w", errorPrefix, err))

0 commit comments

Comments
 (0)