helper/diff: fix problems with PreProcess
This commit is contained in:
parent
2cfad3fa71
commit
c89e02c545
|
@ -96,7 +96,7 @@ func (b *ResourceBuilder) Diff(
|
||||||
|
|
||||||
// If we have a pre-processor for this, run it.
|
// If we have a pre-processor for this, run it.
|
||||||
if pp, ok := b.PreProcess[k]; ok {
|
if pp, ok := b.PreProcess[k]; ok {
|
||||||
v = pp(k)
|
v = pp(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,8 +206,8 @@ func TestResourceBuilder_preProcess(t *testing.T) {
|
||||||
},
|
},
|
||||||
|
|
||||||
PreProcess: map[string]PreProcessFunc{
|
PreProcess: map[string]PreProcessFunc{
|
||||||
"foo": func(string) string {
|
"foo": func(v string) string {
|
||||||
return "bar"
|
return "bar" + v
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -413,7 +413,7 @@ const testRBNewDiff = `UPDATE
|
||||||
`
|
`
|
||||||
|
|
||||||
const testRBPreProcessDiff = `CREATE
|
const testRBPreProcessDiff = `CREATE
|
||||||
IN foo: "" => "bar" (forces new resource)
|
IN foo: "" => "barfoo" (forces new resource)
|
||||||
`
|
`
|
||||||
|
|
||||||
const testRBPreProcessUnknownDiff = `CREATE
|
const testRBPreProcessUnknownDiff = `CREATE
|
||||||
|
|
Loading…
Reference in New Issue