Commit 9d79b487 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

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

Fixes 'unknown configuration key' errors for 'only' and 'except'
parents 8aec42e3 d7c77895
...@@ -134,6 +134,8 @@ func (r *rawTemplate) Template() (*Template, error) { ...@@ -134,6 +134,8 @@ func (r *rawTemplate) Template() (*Template, error) {
} }
// Set the configuration // Set the configuration
delete(c, "except")
delete(c, "only")
delete(c, "keep_input_artifact") delete(c, "keep_input_artifact")
delete(c, "type") delete(c, "type")
if len(c) > 0 { if len(c) > 0 {
......
...@@ -174,6 +174,40 @@ func TestParse(t *testing.T) { ...@@ -174,6 +174,40 @@ func TestParse(t *testing.T) {
false, 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", "parse-pp-string.json",
&Template{ &Template{
......
{
"post-processors": [
{
"type": "foo",
"except": ["bar"]
}
]
}
{
"post-processors": [
{
"type": "foo",
"only": ["bar"]
}
]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment