if encrypt_boot is explicitly set to false, don't copy. Also, make sure we don't cause a wait group block when we aren't performing a copy.
This commit is contained in:
parent
d343852c15
commit
c0e69a9da0
|
@ -51,9 +51,11 @@ func (s *StepAMIRegionCopy) Run(ctx context.Context, state multistep.StateBag) m
|
||||||
|
|
||||||
wg.Add(len(s.Regions))
|
wg.Add(len(s.Regions))
|
||||||
for _, region := range s.Regions {
|
for _, region := range s.Regions {
|
||||||
if region == *ec2conn.Config.Region && s.EncryptBootVolume == nil {
|
if region == *ec2conn.Config.Region &&
|
||||||
|
(s.EncryptBootVolume == nil || *s.EncryptBootVolume == false) {
|
||||||
ui.Message(fmt.Sprintf(
|
ui.Message(fmt.Sprintf(
|
||||||
"Avoiding copying AMI to duplicate region %s", region))
|
"Avoiding copying AMI to duplicate region %s", region))
|
||||||
|
wg.Done()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue