-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
command/validate: add option to eval datasources
When packer validate is invoked, it does not try to evaluate the datasources before attempting to decide if the template is valid. In many cases, this works, but sometimes it will fail as the value is unknown by the validation code. Since the validation code for all the elements of a Packer template is left to be implemented by plugins, we cannot rely on checking for unknown values everywhere, especially since the unknown references are replaced automatically by a value of the right type for the configuration expected. So, in order for such configurations to be validable, we add an extra option to packer validate, that will let users evaluate the datasources from a template.
- Loading branch information
1 parent
113bc5e
commit 6519070
Showing
4 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
data "null" "dep" { | ||
input = "upload" | ||
} | ||
|
||
source "null" "test" { | ||
communicator = "none" | ||
} | ||
|
||
build { | ||
sources = ["sources.null.test"] | ||
|
||
provisioner "file" { | ||
source = "test-fixtures/hcl/force.pkr.hcl" | ||
destination = "dest" | ||
direction = "${data.null.dep.output}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters