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
052b5e66
Commit
052b5e66
authored
Jun 05, 2015
by
Henry Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"Name" parameter required for copying ami across regions [GH-2172]
parent
793698f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
3 deletions
+9
-3
builder/amazon/chroot/builder.go
builder/amazon/chroot/builder.go
+3
-1
builder/amazon/common/step_ami_region_copy.go
builder/amazon/common/step_ami_region_copy.go
+4
-2
builder/amazon/ebs/builder.go
builder/amazon/ebs/builder.go
+1
-0
builder/amazon/instance/builder.go
builder/amazon/instance/builder.go
+1
-0
No files found.
builder/amazon/chroot/builder.go
View file @
052b5e66
...
...
@@ -166,7 +166,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&
StepSnapshot
{},
&
StepRegisterAMI
{},
&
awscommon
.
StepAMIRegionCopy
{
Regions
:
b
.
config
.
AMIRegions
,
AccessConfig
:
&
b
.
config
.
AccessConfig
,
Regions
:
b
.
config
.
AMIRegions
,
Name
:
b
.
config
.
AMIName
,
},
&
awscommon
.
StepModifyAMIAttributes
{
Description
:
b
.
config
.
AMIDescription
,
...
...
builder/amazon/common/step_ami_region_copy.go
View file @
052b5e66
...
...
@@ -14,6 +14,7 @@ import (
type
StepAMIRegionCopy
struct
{
AccessConfig
*
AccessConfig
Regions
[]
string
Name
string
}
func
(
s
*
StepAMIRegionCopy
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
...
...
@@ -37,7 +38,7 @@ func (s *StepAMIRegionCopy) Run(state multistep.StateBag) multistep.StepAction {
go
func
(
region
string
)
{
defer
wg
.
Done
()
id
,
err
:=
amiRegionCopy
(
state
,
s
.
AccessConfig
,
ami
,
region
,
ec2conn
.
Config
.
Region
)
id
,
err
:=
amiRegionCopy
(
state
,
s
.
AccessConfig
,
s
.
Name
,
ami
,
region
,
ec2conn
.
Config
.
Region
)
lock
.
Lock
()
defer
lock
.
Unlock
()
...
...
@@ -69,7 +70,7 @@ func (s *StepAMIRegionCopy) Cleanup(state multistep.StateBag) {
// amiRegionCopy does a copy for the given AMI to the target region and
// returns the resulting ID or error.
func
amiRegionCopy
(
state
multistep
.
StateBag
,
config
*
AccessConfig
,
imageId
string
,
func
amiRegionCopy
(
state
multistep
.
StateBag
,
config
*
AccessConfig
,
name
string
,
imageId
string
,
target
string
,
source
string
)
(
string
,
error
)
{
// Connect to the region where the AMI will be copied to
...
...
@@ -83,6 +84,7 @@ func amiRegionCopy(state multistep.StateBag, config *AccessConfig, imageId strin
resp
,
err
:=
regionconn
.
CopyImage
(
&
ec2
.
CopyImageInput
{
SourceRegion
:
&
source
,
SourceImageID
:
&
imageId
,
Name
:
&
name
,
})
if
err
!=
nil
{
...
...
builder/amazon/ebs/builder.go
View file @
052b5e66
...
...
@@ -123,6 +123,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&
awscommon
.
StepAMIRegionCopy
{
AccessConfig
:
&
b
.
config
.
AccessConfig
,
Regions
:
b
.
config
.
AMIRegions
,
Name
:
b
.
config
.
AMIName
,
},
&
awscommon
.
StepModifyAMIAttributes
{
Description
:
b
.
config
.
AMIDescription
,
...
...
builder/amazon/instance/builder.go
View file @
052b5e66
...
...
@@ -205,6 +205,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&
awscommon
.
StepAMIRegionCopy
{
AccessConfig
:
&
b
.
config
.
AccessConfig
,
Regions
:
b
.
config
.
AMIRegions
,
Name
:
b
.
config
.
AMIName
,
},
&
awscommon
.
StepModifyAMIAttributes
{
Description
:
b
.
config
.
AMIDescription
,
...
...
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