Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for arm64_mac architecture #487

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .web-docs/components/builder/chroot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ necessary for this build to succeed and can be found further down the page.
prefix `kms_key_id` with `alias/`.

- `ami_architecture` (string) - what architecture to use when registering the final AMI; valid options
are "arm64", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".
are "arm64", "arm64_mac", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".

- `boot_mode` (string) - The boot mode. Valid options are `legacy-bios` and `uefi`. See the documentation on
[boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) for
Expand Down
2 changes: 1 addition & 1 deletion .web-docs/components/builder/ebssurrogate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ necessary for this build to succeed and can be found further down the page.
will allow you to create those programatically.

- `ami_architecture` (string) - what architecture to use when registering the final AMI; valid options
are "arm64", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".
are "arm64", "arm64_mac", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".

- `boot_mode` (string) - The boot mode. Valid options are `legacy-bios` and `uefi`. See the documentation on
[boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) for
Expand Down
6 changes: 3 additions & 3 deletions builder/chroot/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ type Config struct {
// prefix `kms_key_id` with `alias/`.
RootVolumeKmsKeyId string `mapstructure:"root_volume_kms_key_id" required:"false"`
// what architecture to use when registering the final AMI; valid options
// are "arm64", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".
// are "arm64", "arm64_mac", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".
lbajolet-hashicorp marked this conversation as resolved.
Show resolved Hide resolved
Architecture string `mapstructure:"ami_architecture" required:"false"`
// The boot mode. Valid options are `legacy-bios` and `uefi`. See the documentation on
// [boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) for
Expand Down Expand Up @@ -370,14 +370,14 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) {

}
valid := false
for _, validArch := range []string{"arm64", "i386", "x86_64", "x86_64_mac"} {
for _, validArch := range []string{"arm64", "arm64_mac", "i386", "x86_64", "x86_64_mac"} {
lbajolet-hashicorp marked this conversation as resolved.
Show resolved Hide resolved
if validArch == b.config.Architecture {
valid = true
break
}
}
if !valid {
errs = packersdk.MultiErrorAppend(errs, errors.New(`The only valid ami_architecture values are "arm64", "i386", "x86_64", or "x86_64_mac"`))
errs = packersdk.MultiErrorAppend(errs, errors.New(`The only valid ami_architecture values are "arm64", "arm64_mac", "i386", "x86_64", or "x86_64_mac"`))
}

if b.config.TpmSupport != "" && b.config.TpmSupport != ec2.TpmSupportValuesV20 {
Expand Down
6 changes: 3 additions & 3 deletions builder/ebssurrogate/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type Config struct {
// will allow you to create those programatically.
VolumeRunTag config.NameValues `mapstructure:"run_volume_tag" required:"false"`
// what architecture to use when registering the final AMI; valid options
// are "arm64", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".
// are "arm64", "arm64_mac", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".
Architecture string `mapstructure:"ami_architecture" required:"false"`
// The boot mode. Valid options are `legacy-bios` and `uefi`. See the documentation on
// [boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) for
Expand Down Expand Up @@ -186,14 +186,14 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) {
b.config.Architecture = "x86_64"
}
valid := false
for _, validArch := range []string{"arm64", "i386", "x86_64", "x86_64_mac"} {
for _, validArch := range []string{"arm64", "arm64_mac", "i386", "x86_64", "x86_64_mac"} {
if validArch == b.config.Architecture {
valid = true
break
}
}
if !valid {
errs = packersdk.MultiErrorAppend(errs, errors.New(`The only valid ami_architecture values are "arm64", "i386", "x86_64", or "x86_64_mac"`))
errs = packersdk.MultiErrorAppend(errs, errors.New(`The only valid ami_architecture values are "arm64", "arm64_mac", "i386", "x86_64", or "x86_64_mac"`))
}

if b.config.TpmSupport != "" && b.config.TpmSupport != ec2.TpmSupportValuesV20 {
Expand Down
2 changes: 1 addition & 1 deletion docs-partials/builder/chroot/Config-not-required.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
prefix `kms_key_id` with `alias/`.

- `ami_architecture` (string) - what architecture to use when registering the final AMI; valid options
are "arm64", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".
are "arm64", "arm64_mac", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".

- `boot_mode` (string) - The boot mode. Valid options are `legacy-bios` and `uefi`. See the documentation on
[boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
will allow you to create those programatically.

- `ami_architecture` (string) - what architecture to use when registering the final AMI; valid options
are "arm64", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".
are "arm64", "arm64_mac", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".

- `boot_mode` (string) - The boot mode. Valid options are `legacy-bios` and `uefi`. See the documentation on
[boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) for
Expand Down