Merge pull request #2171 from jgkim/hotfix/post-processor-only-except

Fixes 'unknown configuration key' errors for 'only' and 'except'
pull/2190/head
Mitchell Hashimoto 11 years ago
commit 9d79b48723

@ -134,6 +134,8 @@ func (r *rawTemplate) Template() (*Template, error) {
}
// Set the configuration
delete(c, "except")
delete(c, "only")
delete(c, "keep_input_artifact")
delete(c, "type")
if len(c) > 0 {

@ -174,6 +174,40 @@ func TestParse(t *testing.T) {
false,
},
{
"parse-pp-only.json",
&Template{
PostProcessors: [][]*PostProcessor{
[]*PostProcessor{
&PostProcessor{
Type: "foo",
OnlyExcept: OnlyExcept{
Only: []string{"bar"},
},
},
},
},
},
false,
},
{
"parse-pp-except.json",
&Template{
PostProcessors: [][]*PostProcessor{
[]*PostProcessor{
&PostProcessor{
Type: "foo",
OnlyExcept: OnlyExcept{
Except: []string{"bar"},
},
},
},
},
},
false,
},
{
"parse-pp-string.json",
&Template{

@ -0,0 +1,8 @@
{
"post-processors": [
{
"type": "foo",
"except": ["bar"]
}
]
}

@ -0,0 +1,8 @@
{
"post-processors": [
{
"type": "foo",
"only": ["bar"]
}
]
}
Loading…
Cancel
Save