packer-cn/helper
Wilken Rivera f672f5bd9b command/validate: Add support for HCL2 configuration files
* Update validate command to use FixConfig for checking against known
fixers
* Update validation command flag docs
* Add ConfigFixer method to PackerHandler Interface
* Implement ConfigFixer interface in PackerConfig
* Remove all stdout messaging (i.e calls to c.Ui.Say) in the validate
command. The command will only display hcl.Diagnotic messaging when there is an error or warning.

HCL2 Configs
```
⇶  packer validate docker_centos_shell_provisioner.pkr.hcl

```

JSON Configs
```
⇶  packer validate vmware-iso_ubuntu_minimal/vmware-iso_ubuntu_minimal.json
Error: Failed to prepare build: "vmware-iso"

1 error occurred:
        * Deprecated configuration key: 'iso_checksum_type'. Please call `packer fix`
against your template to update your template to be compatable with the current
version of Packer. Visit https://www.packer.io/docs/commands/fix/ for more
detail.

Warning: Fixable configuration found.
You may need to run `packer fix` to get your build to run correctly.
See debug log for more information.

  map[string]interface{}{
        "builders": []interface{}{
                map[string]interface{}{
                        ... // 3 identical entries
                        "guest_os_type":     string("ubuntu-64"),
                        "http_directory":    string("http"),
-                       "iso_checksum":
string("946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2"),
+                       "iso_checksum":
string("sha256:946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2"),
-                       "iso_checksum_type": string("sha256"),
                        "iso_url":
string("http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso"),
                        "shutdown_command":  string("echo 'vagrant' | sudo -S shutdown -P now"),
                        ... // 4 identical entries
                },
        },
  }
```
2020-06-05 14:24:39 -04:00
..
builder/testing helper/builder/testing: prune unused functions (#8852) 2020-03-09 10:46:32 +01:00
common Replace file shared state by statebag (#9238) 2020-05-19 11:49:48 +02:00
communicator HCL2: generate hcl tags with go-cty tags too (#9306) 2020-05-28 11:19:00 +02:00
config command/validate: Add support for HCL2 configuration files 2020-06-05 14:24:39 -04:00
enumflag Fail on unknown values of -on-error 2016-09-17 14:42:21 +00:00
flag-kv TestStringSlice_Set: check error even if none is returned 2020-03-12 18:01:20 +01:00
flag-slice Support -flag=var1,var2,var3 to fix #2332 2015-06-26 17:54:59 -07:00
multistep rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
ssh Add golangci-lint to project (#8686) 2020-02-14 11:42:29 -05:00
tests tests/provisioners: Add TestProvsionerPreCheck function 2020-04-06 16:52:24 -04:00
useragent Include arch and os 2018-04-05 14:28:50 -04:00
wrappedreadline golang 1.14 doesn't like calling NewFile on existing files. Port solution over from Terraform 2020-04-09 14:38:17 -07:00
wrappedstreams golang 1.14 doesn't like calling NewFile on existing files. Port solution over from Terraform 2020-04-09 14:38:17 -07:00