fix tests

This commit is contained in:
Megan Marsh 2021-03-18 10:02:27 -07:00
parent 0ecc4b5e52
commit 4242cf3151
3 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,7 @@ variable "env_test" {
}
locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
# The "legacy_isotime" function has been provided for backwards compatability, but we recommend switching to the timestamp and formatdate functions.
# 5 errors occurred upgrading the following block:
# unhandled "lower" call:
@ -33,7 +34,7 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
# Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/upper for more infos.
locals {
build_timestamp = "${local.timestamp}"
iso_datetime = "${local.timestamp}"
iso_datetime = "${legacy_isotime("2006-01-02T15:04:05Z07:00")}"
lower = "{{ lower `HELLO` }}"
pwd = "${path.cwd}"
replace = "{{ replace `b` `c` `ababa` 2 }}"

View File

@ -198,7 +198,7 @@ build {
# Please manually upgrade to use custom validation rules, `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
# Visit https://packer.io/docs/templates/hcl_templates/variables#custom-validation-rules , https://www.packer.io/docs/templates/hcl_templates/functions/string/replace or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace for more infos.
provisioner "shell" {
inline = ["echo mybuild-{{ clean_resource_name `${local.timestamp}` }}"]
inline = ["echo mybuild-{{ clean_resource_name `${timestamp()}` }}"]
}

View File

@ -151,7 +151,7 @@ build {
# Please manually upgrade to use custom validation rules, `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
# Visit https://packer.io/docs/templates/hcl_templates/variables#custom-validation-rules , https://www.packer.io/docs/templates/hcl_templates/functions/string/replace or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace for more infos.
provisioner "shell" {
inline = ["echo mybuild-{{ clean_resource_name `${local.timestamp}` }}"]
inline = ["echo mybuild-{{ clean_resource_name `${timestamp()}` }}"]
}