terraform: planning tainted resources works
This commit is contained in:
parent
157843725d
commit
10b5661bc3
|
@ -759,6 +759,11 @@ func (c *Context) planWalkFn(result *Plan) depgraph.WalkFunc {
|
|||
result.init()
|
||||
|
||||
cb := func(r *Resource) error {
|
||||
if r.Tainted && r.TaintedIndex > -1 {
|
||||
// No-op this. We somewhat magically diff this later.
|
||||
return nil
|
||||
}
|
||||
|
||||
var diff *InstanceDiff
|
||||
|
||||
is := r.State.Primary
|
||||
|
@ -895,7 +900,7 @@ func (c *Context) planDestroyWalkFn(result *Plan) depgraph.WalkFunc {
|
|||
func (c *Context) refreshWalkFn() depgraph.WalkFunc {
|
||||
cb := func(r *Resource) error {
|
||||
is := r.State.Primary
|
||||
if r.Tainted {
|
||||
if r.Tainted && r.TaintedIndex > -1 {
|
||||
is = r.State.Tainted[r.TaintedIndex]
|
||||
}
|
||||
|
||||
|
|
|
@ -271,10 +271,11 @@ func graphAddConfigResources(
|
|||
Type: r.Type,
|
||||
Config: r,
|
||||
Resource: &Resource{
|
||||
Id: name,
|
||||
State: state,
|
||||
Config: NewResourceConfig(r.RawConfig),
|
||||
Tainted: len(state.Tainted) > 0,
|
||||
Id: name,
|
||||
State: state,
|
||||
Config: NewResourceConfig(r.RawConfig),
|
||||
Tainted: len(state.Tainted) > 0,
|
||||
TaintedIndex: -1,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue