Merge pull request #9585 from hashicorp/azr-fix-uint64-buildvars
post-processor/provisioner: handle uint64 buildvars
This commit is contained in:
commit
b2f8ba9991
|
@ -37,6 +37,8 @@ func (p *HCL2PostProcessor) HCL2Prepare(buildVars map[string]interface{}) error
|
||||||
buildValues[k] = cty.StringVal(v)
|
buildValues[k] = cty.StringVal(v)
|
||||||
case int64:
|
case int64:
|
||||||
buildValues[k] = cty.NumberIntVal(v)
|
buildValues[k] = cty.NumberIntVal(v)
|
||||||
|
case uint64:
|
||||||
|
buildValues[k] = cty.NumberUIntVal(v)
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unhandled buildvar type: %T", v)
|
return fmt.Errorf("unhandled buildvar type: %T", v)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package hcl2template
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2"
|
"github.com/hashicorp/hcl/v2"
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
|
@ -36,6 +37,8 @@ func (p *HCL2Provisioner) HCL2Prepare(buildVars map[string]interface{}) error {
|
||||||
buildValues[k] = cty.StringVal(v)
|
buildValues[k] = cty.StringVal(v)
|
||||||
case int64:
|
case int64:
|
||||||
buildValues[k] = cty.NumberIntVal(v)
|
buildValues[k] = cty.NumberIntVal(v)
|
||||||
|
case uint64:
|
||||||
|
buildValues[k] = cty.NumberUIntVal(v)
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unhandled buildvar type: %T", v)
|
return fmt.Errorf("unhandled buildvar type: %T", v)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue