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
2b801a7b
Commit
2b801a7b
authored
Dec 28, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware,virtualbox: checksum_type can be "none" [GH-471]
parent
e38c0424
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
10 deletions
+65
-10
CHANGELOG.md
CHANGELOG.md
+2
-0
builder/virtualbox/iso/builder.go
builder/virtualbox/iso/builder.go
+12
-4
builder/virtualbox/iso/builder_test.go
builder/virtualbox/iso/builder_test.go
+15
-0
builder/vmware/iso/builder.go
builder/vmware/iso/builder.go
+12
-4
builder/vmware/iso/builder_test.go
builder/vmware/iso/builder_test.go
+16
-0
website/source/docs/builders/virtualbox-iso.html.markdown
website/source/docs/builders/virtualbox-iso.html.markdown
+4
-1
website/source/docs/builders/vmware-iso.html.markdown
website/source/docs/builders/vmware-iso.html.markdown
+4
-1
No files found.
CHANGELOG.md
View file @
2b801a7b
...
...
@@ -64,7 +64,9 @@ IMPROVEMENTS:
*
builder/virtualbox: Nice errors if Packer can't write to
the output directory.
*
builder/virtualbox: ISO is ejected prior to export.
*
builder/virtualbox: Checksum type can be "none" [GH-471]
*
builder/vmware: Can now specify path to the Fusion application. [GH-677]
*
builder/vmware: Checksum type can be "none" [GH-471]
*
provisioner/puppet-masterless: Can now specify a
`manifest_dir`
to
upload manifests to the remote machine for imports. [GH-655]
...
...
builder/virtualbox/iso/builder.go
View file @
2b801a7b
...
...
@@ -187,10 +187,12 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
errs
,
errors
.
New
(
"The iso_checksum_type must be specified."
))
}
else
{
b
.
config
.
ISOChecksumType
=
strings
.
ToLower
(
b
.
config
.
ISOChecksumType
)
if
h
:=
common
.
HashForType
(
b
.
config
.
ISOChecksumType
);
h
==
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Unsupported checksum type: %s"
,
b
.
config
.
ISOChecksumType
))
if
b
.
config
.
ISOChecksumType
!=
"none"
{
if
h
:=
common
.
HashForType
(
b
.
config
.
ISOChecksumType
);
h
==
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Unsupported checksum type: %s"
,
b
.
config
.
ISOChecksumType
))
}
}
}
...
...
@@ -236,6 +238,12 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
}
// Warnings
if
b
.
config
.
ISOChecksumType
==
"none"
{
warnings
=
append
(
warnings
,
"A checksum type of 'none' was specified. Since ISO files are so big,
\n
"
+
"a checksum is highly recommended."
)
}
if
b
.
config
.
ShutdownCommand
==
""
{
warnings
=
append
(
warnings
,
"A shutdown_command was not specified. Without a shutdown command, Packer
\n
"
+
...
...
builder/virtualbox/iso/builder_test.go
View file @
2b801a7b
...
...
@@ -383,6 +383,21 @@ func TestBuilderPrepare_ISOChecksumType(t *testing.T) {
if
err
==
nil
{
t
.
Fatal
(
"should have error"
)
}
// Test none
config
[
"iso_checksum_type"
]
=
"none"
b
=
Builder
{}
warns
,
err
=
b
.
Prepare
(
config
)
if
len
(
warns
)
==
0
{
t
.
Fatalf
(
"bad: %#v"
,
warns
)
}
if
err
!=
nil
{
t
.
Fatalf
(
"should not have error: %s"
,
err
)
}
if
b
.
config
.
ISOChecksumType
!=
"none"
{
t
.
Fatalf
(
"should've lowercased: %s"
,
b
.
config
.
ISOChecksumType
)
}
}
func
TestBuilderPrepare_ISOUrl
(
t
*
testing
.
T
)
{
...
...
builder/vmware/iso/builder.go
View file @
2b801a7b
...
...
@@ -218,10 +218,12 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
errs
,
errors
.
New
(
"The iso_checksum_type must be specified."
))
}
else
{
b
.
config
.
ISOChecksumType
=
strings
.
ToLower
(
b
.
config
.
ISOChecksumType
)
if
h
:=
common
.
HashForType
(
b
.
config
.
ISOChecksumType
);
h
==
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Unsupported checksum type: %s"
,
b
.
config
.
ISOChecksumType
))
if
b
.
config
.
ISOChecksumType
!=
"none"
{
if
h
:=
common
.
HashForType
(
b
.
config
.
ISOChecksumType
);
h
==
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Unsupported checksum type: %s"
,
b
.
config
.
ISOChecksumType
))
}
}
}
...
...
@@ -270,6 +272,12 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
}
// Warnings
if
b
.
config
.
ISOChecksumType
==
"none"
{
warnings
=
append
(
warnings
,
"A checksum type of 'none' was specified. Since ISO files are so big,
\n
"
+
"a checksum is highly recommended."
)
}
if
b
.
config
.
ShutdownCommand
==
""
{
warnings
=
append
(
warnings
,
"A shutdown_command was not specified. Without a shutdown command, Packer
\n
"
+
...
...
builder/vmware/iso/builder_test.go
View file @
2b801a7b
...
...
@@ -98,7 +98,23 @@ func TestBuilderPrepare_ISOChecksumType(t *testing.T) {
if
err
==
nil
{
t
.
Fatal
(
"should have error"
)
}
// Test none
config
[
"iso_checksum_type"
]
=
"none"
b
=
Builder
{}
warns
,
err
=
b
.
Prepare
(
config
)
if
len
(
warns
)
==
0
{
t
.
Fatalf
(
"bad: %#v"
,
warns
)
}
if
err
!=
nil
{
t
.
Fatalf
(
"should not have error: %s"
,
err
)
}
if
b
.
config
.
ISOChecksumType
!=
"none"
{
t
.
Fatalf
(
"should've lowercased: %s"
,
b
.
config
.
ISOChecksumType
)
}
}
func
TestBuilderPrepare_Defaults
(
t
*
testing
.
T
)
{
var
b
Builder
config
:=
testConfig
()
...
...
website/source/docs/builders/virtualbox-iso.html.markdown
View file @
2b801a7b
...
...
@@ -54,7 +54,10 @@ Required:
checksum is specified with
`iso_checksum_type`
, documented below.
*
`iso_checksum_type`
(string) - The type of the checksum specified in
`iso_checksum`
. Valid values are "md5", "sha1", "sha256", or "sha512" currently.
`iso_checksum`
. Valid values are "none", "md5", "sha1", "sha256", or
"sha512" currently. While "none" will skip checksumming, this is not
recommended since ISO files are generally large and corruption does happen
from time to time.
*
`iso_url`
(string) - A URL to the ISO containing the installation image.
This URL can be either an HTTP URL or a file URL (or path to a file).
...
...
website/source/docs/builders/vmware-iso.html.markdown
View file @
2b801a7b
...
...
@@ -55,7 +55,10 @@ Required:
checksum is specified with
`iso_checksum_type`
, documented below.
*
`iso_checksum_type`
(string) - The type of the checksum specified in
`iso_checksum`
. Valid values are "md5", "sha1", "sha256", or "sha512" currently.
`iso_checksum`
. Valid values are "none", "md5", "sha1", "sha256", or
"sha512" currently. While "none" will skip checksumming, this is not
recommended since ISO files are generally large and corruption does happen
from time to time.
*
`iso_url`
(string) - A URL to the ISO containing the installation image.
This URL can be either an HTTP URL or a file URL (or path to a file).
...
...
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