Treat missing variables during destroy as unknown
This commit is contained in:
parent
40b04154fe
commit
3a05f01553
|
@ -342,7 +342,7 @@ func (i *Interpolater) computeResourceVariable(
|
||||||
// TODO: test by creating a state and configuration that is referencing
|
// TODO: test by creating a state and configuration that is referencing
|
||||||
// a non-existent variable "foo.bar" where the state only has "foo"
|
// a non-existent variable "foo.bar" where the state only has "foo"
|
||||||
// and verify plan works, but apply doesn't.
|
// and verify plan works, but apply doesn't.
|
||||||
if i.Operation == walkApply {
|
if i.Operation == walkApply || i.Operation == walkDestroy {
|
||||||
goto MISSING
|
goto MISSING
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ MISSING:
|
||||||
//
|
//
|
||||||
// For an input walk, computed values are okay to return because we're only
|
// For an input walk, computed values are okay to return because we're only
|
||||||
// looking for missing variables to prompt the user for.
|
// looking for missing variables to prompt the user for.
|
||||||
if i.Operation == walkRefresh || i.Operation == walkPlanDestroy || i.Operation == walkInput {
|
if i.Operation == walkRefresh || i.Operation == walkPlanDestroy || i.Operation == walkDestroy || i.Operation == walkInput {
|
||||||
return config.UnknownVariableValue, nil
|
return config.UnknownVariableValue, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,7 +481,7 @@ func (i *Interpolater) computeResourceMultiVariable(
|
||||||
//
|
//
|
||||||
// For an input walk, computed values are okay to return because we're only
|
// For an input walk, computed values are okay to return because we're only
|
||||||
// looking for missing variables to prompt the user for.
|
// looking for missing variables to prompt the user for.
|
||||||
if i.Operation == walkRefresh || i.Operation == walkPlanDestroy || i.Operation == walkInput {
|
if i.Operation == walkRefresh || i.Operation == walkPlanDestroy || i.Operation == walkDestroy || i.Operation == walkInput {
|
||||||
return config.UnknownVariableValue, nil
|
return config.UnknownVariableValue, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue