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
6c7a7b60
Commit
6c7a7b60
authored
Jun 29, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/googlecompute: default SSH settings properly [GH-2340]
parent
1aef60ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
builder/googlecompute/config.go
builder/googlecompute/config.go
+3
-0
builder/googlecompute/config_test.go
builder/googlecompute/config_test.go
+29
-0
No files found.
builder/googlecompute/config.go
View file @
6c7a7b60
...
...
@@ -97,6 +97,9 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
}
var
errs
*
packer
.
MultiError
if
es
:=
c
.
Comm
.
Prepare
(
&
c
.
ctx
);
len
(
es
)
>
0
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
es
...
)
}
// Process required parameters.
if
c
.
ProjectId
==
""
{
...
...
builder/googlecompute/config_test.go
View file @
6c7a7b60
...
...
@@ -152,6 +152,35 @@ func TestConfigPrepare(t *testing.T) {
}
}
func
TestConfigDefaults
(
t
*
testing
.
T
)
{
cases
:=
[]
struct
{
Read
func
(
c
*
Config
)
interface
{}
Value
interface
{}
}{
{
func
(
c
*
Config
)
interface
{}
{
return
c
.
Comm
.
Type
},
"ssh"
,
},
{
func
(
c
*
Config
)
interface
{}
{
return
c
.
Comm
.
SSHPort
},
22
,
},
}
for
_
,
tc
:=
range
cases
{
raw
:=
testConfig
(
t
)
c
,
warns
,
errs
:=
NewConfig
(
raw
)
testConfigOk
(
t
,
warns
,
errs
)
actual
:=
tc
.
Read
(
c
)
if
actual
!=
tc
.
Value
{
t
.
Fatalf
(
"bad: %#v"
,
actual
)
}
}
}
func
testAccountFile
(
t
*
testing
.
T
)
string
{
tf
,
err
:=
ioutil
.
TempFile
(
""
,
"packer"
)
if
err
!=
nil
{
...
...
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