pull/7620/head
Megan Marsh 7 years ago
parent 02c9f24531
commit 2cfba56265

@ -83,7 +83,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
}
if b.config.Architecture == "" {
b.config.Architecture == "x86_64"
b.config.Architecture = "x86_64"
}
if b.config.PackerConfig.PackerForce {
@ -186,9 +186,9 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
}
}
valid := false
for validArch, _ := range []string{"x86_64", "arm64"} {
for _, validArch := range []string{"x86_64", "arm64"} {
if validArch == b.config.Architecture {
matched = true
valid = true
break
}
}
@ -291,7 +291,6 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
RootVolumeSize: b.config.RootVolumeSize,
EnableAMISriovNetSupport: b.config.AMISriovNetSupport,
EnableAMIENASupport: b.config.AMIENASupport,
Architecture: b.config.Architecture,
},
&awscommon.StepAMIRegionCopy{
AccessConfig: &b.config.AccessConfig,

@ -16,7 +16,6 @@ type StepRegisterAMI struct {
RootVolumeSize int64
EnableAMIENASupport *bool
EnableAMISriovNetSupport bool
Architecture string
}
func (s *StepRegisterAMI) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
@ -118,7 +117,7 @@ func buildBaseRegisterOpts(config *Config, sourceImage *ec2.Image, rootVolumeSiz
if config.FromScratch {
return &ec2.RegisterImageInput{
Name: &config.AMIName,
Architecture: aws.String(s.Architecture),
Architecture: aws.String(config.Architecture),
RootDeviceName: aws.String(rootDeviceName),
VirtualizationType: aws.String(config.AMIVirtType),
BlockDeviceMappings: newMappings,

@ -94,12 +94,12 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
}
if b.config.Architecture == "" {
b.config.Architecture == "x86_64"
b.config.Architecture = "x86_64"
}
valid := false
for validArch, _ := range []string{"x86_64", "arm64"} {
for _, validArch := range []string{"x86_64", "arm64"} {
if validArch == b.config.Architecture {
matched = true
valid = true
break
}
}

Loading…
Cancel
Save