-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packer fails to validate deprecate_at
unless it's a literal string
#493
Comments
Hi @saxonww,
Note: scratch all that, I misunderstood the question, but the information may still interest someone who stumbles on this thread. |
Overview of the Issue
I am using the
amazon-ebs
builder with theamazon-ami
data source, to build a custom AMI based off an existing upstream AMI.I've found that I can't run
packer validate
if I setdeprecate_at
to anything other than a literal string. My upstream AMI is replaced on a schedule, so I wanted to setdeprecate_at
to e.g.timeadd(data.amazon-ami.source.creation_date, duration)
. But when I do, I get an error like the following:I think this is a bug:
timeadd(...)
with the value written to the file, it validates.timeadd(data.amazon-ami...)
withtimeadd(timestamp(), ...)
, it validates.packer build example.pkr.hcl
it works fine, setting the expected deprecation time.This blocks me because my CI routine runs
packer validate
on the template, so even thoughpacker build
would work, CI fails. I would have to work around it by calculating the deprecation_time outside Packer and passing the result in as a variable.Maybe this is a Packer problem? The data source is not evaluated by
packer validate
, and the parameter expects a particularly-formatted string, so there would be no way to ensure a calculated value is valid. I wonder if, instead of failing to validate, this could issue a warning instead?Reproduction Steps
See gist at https://gist.github.com/saxonww/d237f1ff2a3292cf916b02d85eca8cb5
Plugin and Packer version
Packer v1.10.1
Plugin version v1.3.2
Simplified Packer Buildfile
See gist at https://gist.github.com/saxonww/d237f1ff2a3292cf916b02d85eca8cb5
Operating system and Environment details
A Docker container based on the following:
Architecture is x86_64.
Log Fragments and crash.log files
Setting PACKER_LOG=1 doesn't yield anything useful.
The text was updated successfully, but these errors were encountered: