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
cad67897
Commit
cad67897
authored
Jul 19, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #199 from qur/builder-name
packer: builder name should be removed from rawConfig
parents
f415fc18
40897fdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
packer/template.go
packer/template.go
+4
-0
packer/template_test.go
packer/template_test.go
+13
-0
No files found.
packer/template.go
View file @
cad67897
...
...
@@ -161,6 +161,10 @@ func ParseTemplate(data []byte) (t *Template, err error) {
continue
}
// Now that we have the name, remove it from the config - as the builder
// itself doesn't know about, and it will cause a validation error.
delete
(
v
,
"name"
)
raw
.
rawConfig
=
v
t
.
Builders
[
raw
.
Name
]
=
raw
...
...
packer/template_test.go
View file @
cad67897
...
...
@@ -128,6 +128,19 @@ func TestParseTemplate_BuilderWithName(t *testing.T) {
builder
,
ok
:=
result
.
Builders
[
"bob"
]
assert
.
True
(
ok
,
"should have bob builder"
)
assert
.
Equal
(
builder
.
Type
,
"amazon-ebs"
,
"builder should be amazon-ebs"
)
rawConfig
:=
builder
.
rawConfig
if
rawConfig
==
nil
{
t
.
Fatal
(
"missing builder raw config"
)
}
expected
:=
map
[
string
]
interface
{}{
"type"
:
"amazon-ebs"
,
}
if
!
reflect
.
DeepEqual
(
rawConfig
,
expected
)
{
t
.
Fatalf
(
"bad raw: %#v"
,
rawConfig
)
}
}
func
TestParseTemplate_BuilderWithConflictingName
(
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