update comments around evaluating 0 instances
This commit is contained in:
parent
ced7aedeca
commit
a3c9d7abc1
|
@ -658,24 +658,21 @@ func (d *evaluationStateData) GetResource(addr addrs.Resource, rng tfdiags.Sourc
|
||||||
case config.ForEach != nil:
|
case config.ForEach != nil:
|
||||||
return cty.EmptyObjectVal, diags
|
return cty.EmptyObjectVal, diags
|
||||||
default:
|
default:
|
||||||
// FIXME: try to prove this path should not be reached during plan.
|
// While we can reference an expanded resource with 0
|
||||||
//
|
|
||||||
// while we can reference an expanded resource with 0
|
|
||||||
// instances, we cannot reference instances that do not exist.
|
// instances, we cannot reference instances that do not exist.
|
||||||
// Since we haven't ensured that all instances exist in all
|
// Due to the fact that we may have direct references to
|
||||||
// cases (this path only ever returned unknown), only log this as
|
// instances that may end up in a root output during destroy
|
||||||
// an error for now, and continue to return a DynamicVal
|
// (since a planned destroy cannot yet remove root outputs), we
|
||||||
|
// need to return a dynamic value here to allow evaluation to
|
||||||
|
// continue.
|
||||||
log.Printf("[ERROR] unknown instance %q referenced during plan", addr.Absolute(d.ModulePath))
|
log.Printf("[ERROR] unknown instance %q referenced during plan", addr.Absolute(d.ModulePath))
|
||||||
return cty.DynamicVal, diags
|
return cty.DynamicVal, diags
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// we must return DynamicVal so that both interpretations
|
// We should only end up here during the validate walk,
|
||||||
// can proceed without generating errors, and we'll deal with this
|
|
||||||
// in a later step where more information is gathered.
|
|
||||||
// (In practice we should only end up here during the validate walk,
|
|
||||||
// since later walks should have at least partial states populated
|
// since later walks should have at least partial states populated
|
||||||
// for all resources in the configuration.)
|
// for all resources in the configuration.
|
||||||
return cty.DynamicVal, diags
|
return cty.DynamicVal, diags
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue