generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
builder: add acctests for image_architecture
The image_architecture attribute when introduced caused problems with some existing configs, so to avoid introducing further bugs in the future, we add new accetpance tests that ensure the default value is maintained, and that the architecture is forwarded to the final image being created.
- Loading branch information
1 parent
b2608b4
commit 79ce661
Showing
2 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
variable "project" { | ||
type = string | ||
default = "${env("GOOGLE_PROJECT_ID")}" | ||
} | ||
|
||
locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") } | ||
|
||
source "googlecompute" "autogenerated_1" { | ||
image_name = "%s" | ||
project_id = "${var.project}" | ||
source_image_family = "%s" | ||
ssh_username = "packer" | ||
zone = "us-central1-a" | ||
image_architecture = "%s" | ||
machine_type = "%s" | ||
} | ||
|
||
build { | ||
sources = ["source.googlecompute.autogenerated_1"] | ||
} |