Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
a329d7dd
Commit
a329d7dd
authored
Aug 19, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer: remove keep_input_artifact prior to sending to build [GH-310]
parent
be5ed793
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
12 deletions
+21
-12
CHANGELOG.md
CHANGELOG.md
+1
-0
packer/build.go
packer/build.go
+1
-1
packer/build_test.go
packer/build_test.go
+10
-10
packer/template.go
packer/template.go
+4
-1
packer/template_test.go
packer/template_test.go
+5
-0
No files found.
CHANGELOG.md
View file @
a329d7dd
...
...
@@ -11,6 +11,7 @@ IMPROVEMENTS:
BUG FIXES:
*
core: No more "unused key keep_input_artifact" for post processors [GH-310]
*
post-processor/vagrant:
`output_path`
templates now work again.
## 0.3.2 (August 18, 2013)
...
...
packer/build.go
View file @
a329d7dd
...
...
@@ -90,7 +90,7 @@ type coreBuild struct {
type
coreBuildPostProcessor
struct
{
processor
PostProcessor
processorType
string
config
interface
{}
config
map
[
string
]
interface
{}
keepInputArtifact
bool
}
...
...
packer/build_test.go
View file @
a329d7dd
...
...
@@ -20,7 +20,7 @@ func testBuild() *coreBuild {
},
postProcessors
:
[][]
coreBuildPostProcessor
{
[]
coreBuildPostProcessor
{
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp"
},
"testPP"
,
42
,
true
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp"
},
"testPP"
,
make
(
map
[
string
]
interface
{})
,
true
},
},
},
variables
:
make
(
map
[
string
]
string
),
...
...
@@ -66,7 +66,7 @@ func TestBuild_Prepare(t *testing.T) {
corePP
:=
build
.
postProcessors
[
0
][
0
]
pp
:=
corePP
.
processor
.
(
*
TestPostProcessor
)
assert
.
True
(
pp
.
configCalled
,
"config should be called"
)
assert
.
Equal
(
pp
.
configVal
,
[]
interface
{}{
42
,
packerConfig
},
"config should have right value"
)
assert
.
Equal
(
pp
.
configVal
,
[]
interface
{}{
make
(
map
[
string
]
interface
{})
,
packerConfig
},
"config should have right value"
)
}
func
TestBuild_Prepare_Twice
(
t
*
testing
.
T
)
{
...
...
@@ -231,7 +231,7 @@ func TestBuild_Run_Artifacts(t *testing.T) {
build
=
testBuild
()
build
.
postProcessors
=
[][]
coreBuildPostProcessor
{
[]
coreBuildPostProcessor
{
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp"
},
"pp"
,
42
,
false
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp"
},
"pp"
,
make
(
map
[
string
]
interface
{})
,
false
},
},
}
...
...
@@ -256,10 +256,10 @@ func TestBuild_Run_Artifacts(t *testing.T) {
build
=
testBuild
()
build
.
postProcessors
=
[][]
coreBuildPostProcessor
{
[]
coreBuildPostProcessor
{
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp1"
},
"pp"
,
42
,
false
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp1"
},
"pp"
,
make
(
map
[
string
]
interface
{})
,
false
},
},
[]
coreBuildPostProcessor
{
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp2"
},
"pp"
,
42
,
true
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp2"
},
"pp"
,
make
(
map
[
string
]
interface
{})
,
true
},
},
}
...
...
@@ -284,12 +284,12 @@ func TestBuild_Run_Artifacts(t *testing.T) {
build
=
testBuild
()
build
.
postProcessors
=
[][]
coreBuildPostProcessor
{
[]
coreBuildPostProcessor
{
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp1a"
},
"pp"
,
42
,
false
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp1b"
},
"pp"
,
42
,
true
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp1a"
},
"pp"
,
make
(
map
[
string
]
interface
{})
,
false
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp1b"
},
"pp"
,
make
(
map
[
string
]
interface
{})
,
true
},
},
[]
coreBuildPostProcessor
{
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp2a"
},
"pp"
,
42
,
false
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp2b"
},
"pp"
,
42
,
false
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp2a"
},
"pp"
,
make
(
map
[
string
]
interface
{})
,
false
},
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp2b"
},
"pp"
,
make
(
map
[
string
]
interface
{})
,
false
},
},
}
...
...
@@ -315,7 +315,7 @@ func TestBuild_Run_Artifacts(t *testing.T) {
build
.
postProcessors
=
[][]
coreBuildPostProcessor
{
[]
coreBuildPostProcessor
{
coreBuildPostProcessor
{
&
TestPostProcessor
{
artifactId
:
"pp"
,
keep
:
true
},
"pp"
,
42
,
false
,
&
TestPostProcessor
{
artifactId
:
"pp"
,
keep
:
true
},
"pp"
,
make
(
map
[
string
]
interface
{})
,
false
,
},
},
}
...
...
packer/template.go
View file @
a329d7dd
...
...
@@ -50,7 +50,7 @@ type RawBuilderConfig struct {
type
RawPostProcessorConfig
struct
{
Type
string
KeepInputArtifact
bool
`mapstructure:"keep_input_artifact"`
RawConfig
interface
{}
RawConfig
map
[
string
]
interface
{}
}
// RawProvisionerConfig represents a raw, unprocessed provisioner configuration.
...
...
@@ -189,6 +189,9 @@ func ParseTemplate(data []byte) (t *Template, err error) {
continue
}
// Remove the input keep_input_artifact option
delete
(
pp
,
"keep_input_artifact"
)
config
.
RawConfig
=
pp
}
}
...
...
packer/template_test.go
View file @
a329d7dd
...
...
@@ -623,6 +623,11 @@ func TestTemplate_Build(t *testing.T) {
assert
.
Equal
(
len
(
coreBuild
.
postProcessors
[
1
]),
2
,
"should have correct number"
)
assert
.
False
(
coreBuild
.
postProcessors
[
1
][
0
]
.
keepInputArtifact
,
"shoule be correct"
)
assert
.
True
(
coreBuild
.
postProcessors
[
1
][
1
]
.
keepInputArtifact
,
"shoule be correct"
)
config
:=
coreBuild
.
postProcessors
[
1
][
1
]
.
config
if
_
,
ok
:=
config
[
"keep_input_artifact"
];
ok
{
t
.
Fatal
(
"should not have keep_input_artifact"
)
}
}
func
TestTemplate_Build_ProvisionerOverride
(
t
*
testing
.
T
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment