From 6986fb0e81c55abcc73c3a1fe36d2a03df98f232 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 17 Mar 2021 14:35:30 -0700 Subject: [PATCH] make upgrade set isotime func properly --- command/hcl2_upgrade.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/command/hcl2_upgrade.go b/command/hcl2_upgrade.go index bcc90a6cd..ab6f4ca8d 100644 --- a/command/hcl2_upgrade.go +++ b/command/hcl2_upgrade.go @@ -336,8 +336,12 @@ func transposeTemplatingCalls(s []byte) []byte { return "${local.timestamp}" }, "isotime": func(a ...string) string { - timestamp = true - return "${local.timestamp}" + if len(a) == 0 { + return "${legacy_isotime()}" + } + // otherwise a valid isotime func has one input. + return fmt.Sprintf("${legacy_isotime(\"%s\")}", a[0]) + }, "user": func(in string) string { if _, ok := localsVariableMap[in]; ok {