aws: StepAMIRegionCopy call waitgroup.add only once

This commit is contained in:
Adrien Delorme 2018-11-26 11:32:54 +01:00
parent 0e8afa37d5
commit 6af621c37a
1 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,8 @@ func (s *StepAMIRegionCopy) Run(ctx context.Context, state multistep.StateBag) m
var wg sync.WaitGroup
var regKeyID string
errs := new(packer.MultiError)
wg.Add(len(s.Regions))
for _, region := range s.Regions {
if region == *ec2conn.Config.Region {
ui.Message(fmt.Sprintf(
@ -44,7 +46,6 @@ func (s *StepAMIRegionCopy) Run(ctx context.Context, state multistep.StateBag) m
continue
}
wg.Add(1)
ui.Message(fmt.Sprintf("Copying to: %s", region))
if s.EncryptBootVolume {