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()
|
result.init()
|
||||||
|
|
||||||
cb := func(r *Resource) error {
|
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
|
var diff *InstanceDiff
|
||||||
|
|
||||||
is := r.State.Primary
|
is := r.State.Primary
|
||||||
|
@ -895,7 +900,7 @@ func (c *Context) planDestroyWalkFn(result *Plan) depgraph.WalkFunc {
|
||||||
func (c *Context) refreshWalkFn() depgraph.WalkFunc {
|
func (c *Context) refreshWalkFn() depgraph.WalkFunc {
|
||||||
cb := func(r *Resource) error {
|
cb := func(r *Resource) error {
|
||||||
is := r.State.Primary
|
is := r.State.Primary
|
||||||
if r.Tainted {
|
if r.Tainted && r.TaintedIndex > -1 {
|
||||||
is = r.State.Tainted[r.TaintedIndex]
|
is = r.State.Tainted[r.TaintedIndex]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -271,10 +271,11 @@ func graphAddConfigResources(
|
||||||
Type: r.Type,
|
Type: r.Type,
|
||||||
Config: r,
|
Config: r,
|
||||||
Resource: &Resource{
|
Resource: &Resource{
|
||||||
Id: name,
|
Id: name,
|
||||||
State: state,
|
State: state,
|
||||||
Config: NewResourceConfig(r.RawConfig),
|
Config: NewResourceConfig(r.RawConfig),
|
||||||
Tainted: len(state.Tainted) > 0,
|
Tainted: len(state.Tainted) > 0,
|
||||||
|
TaintedIndex: -1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue