From f3fa8cd617fc5291081cb3a291e897f31a1c520d Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 13 Jul 2020 12:36:02 +0200 Subject: [PATCH] post-processor/provisioner: handle uint64 buildvars --- hcl2template/types.hcl_post-processor.go | 2 ++ hcl2template/types.hcl_provisioner.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/hcl2template/types.hcl_post-processor.go b/hcl2template/types.hcl_post-processor.go index f4a787323..3f659ed9f 100644 --- a/hcl2template/types.hcl_post-processor.go +++ b/hcl2template/types.hcl_post-processor.go @@ -37,6 +37,8 @@ func (p *HCL2PostProcessor) HCL2Prepare(buildVars map[string]interface{}) error buildValues[k] = cty.StringVal(v) case int64: buildValues[k] = cty.NumberIntVal(v) + case uint64: + buildValues[k] = cty.NumberUIntVal(v) default: return fmt.Errorf("unhandled buildvar type: %T", v) } diff --git a/hcl2template/types.hcl_provisioner.go b/hcl2template/types.hcl_provisioner.go index 2652ebfda..4222a7ee3 100644 --- a/hcl2template/types.hcl_provisioner.go +++ b/hcl2template/types.hcl_provisioner.go @@ -3,6 +3,7 @@ package hcl2template import ( "context" "fmt" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer" @@ -36,6 +37,8 @@ func (p *HCL2Provisioner) HCL2Prepare(buildVars map[string]interface{}) error { buildValues[k] = cty.StringVal(v) case int64: buildValues[k] = cty.NumberIntVal(v) + case uint64: + buildValues[k] = cty.NumberUIntVal(v) default: return fmt.Errorf("unhandled buildvar type: %T", v) }