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
a587bd47
Commit
a587bd47
authored
Sep 06, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon/ebs: clean up AMI in error [GH-1186]
parent
669f26a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
CHANGELOG.md
CHANGELOG.md
+1
-0
builder/amazon/ebs/step_create_ami.go
builder/amazon/ebs/step_create_ami.go
+5
-2
No files found.
CHANGELOG.md
View file @
a587bd47
...
...
@@ -63,6 +63,7 @@ BUG FIXES:
*
builder/amazon-chroot: Fix crash in root device check. [GH-1360]
*
builder/amazon-chroot: Add description that Packer made the snapshot
with a time. [GH-1388]
*
builder/amazon-ebs: AMI is deregistered if an error. [GH-1186]
*
builder/amazon-instance: Fix deprecation warning for
`ec2-bundle-vol`
[GH-1424]
*
builder/amazon-instance: Add
`--no-filter`
to the
`ec2-bundle-vol`
...
...
builder/amazon/ebs/step_create_ami.go
View file @
a587bd47
...
...
@@ -69,14 +69,17 @@ func (s *stepCreateAMI) Run(state multistep.StateBag) multistep.StepAction {
}
func
(
s
*
stepCreateAMI
)
Cleanup
(
state
multistep
.
StateBag
)
{
if
s
.
image
==
nil
||
s
.
image
.
State
==
"available"
{
_
,
cancelled
:=
state
.
GetOk
(
multistep
.
StateCancelled
)
_
,
halted
:=
state
.
GetOk
(
multistep
.
StateHalted
)
if
!
cancelled
&&
!
halted
{
return
}
ec2conn
:=
state
.
Get
(
"ec2"
)
.
(
*
ec2
.
EC2
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
ui
.
Say
(
"Deregistering the AMI ..."
)
ui
.
Say
(
"Deregistering the AMI
because cancelation or error
..."
)
if
resp
,
err
:=
ec2conn
.
DeregisterImage
(
s
.
image
.
Id
);
err
!=
nil
{
ui
.
Error
(
fmt
.
Sprintf
(
"Error deregistering AMI, may still be around: %s"
,
err
))
return
...
...
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