On a local developer machine there is a good chance the HCP_ORG_ID and
HCP_PROJECT_ID are not set since the HCP Packer client can derive this
information using the token/secret. This change initializes the location
structure with the information obtained from the client and not the
envs.
Results of tests before change with no HCP_ORG_ID or HCP_PROJECT_ID set
```
par_test.go:185: (*packer_service.PackerServiceGetIterationOK)(nil)
par_test.go:185: &{0 [] } (*models.GrpcGatewayRuntimeError) is not supported by the TextConsumer, can be resolved by supporting TextUnmarshaler interface
--- FAIL: TestAcc_PAR_pkr_build (3.94s)
FAIL
FAIL github.com/hashicorp/packer/internal/registry/acctest 6.446s
testing: warning: no tests to run
PASS
ok github.com/hashicorp/packer/internal/registry/env 0.318s [no tests to run]
FAIL
```
Results of tests after change with no HCP_ORG_ID or HCP_PROJECT_ID set
```
2022/01/18 12:23:48 ui: --> null.example: Published metadata to HCP Packer registry packer/pkr-acctest-temp-2/iterations/01FSQ3EPPY69PMXJSTTFYDPQ5R
--- PASS: TestAcc_PAR_pkr_build (3.20s)
PASS
ok github.com/hashicorp/packer/internal/registry/acctest 5.121s
testing: warning: no tests to run
PASS
ok github.com/hashicorp/packer/internal/registry/env 0.155s [no tests to run]
```
When obtaining image metadata for a HCP Packer build, Packer core will
use mapstructure to decode the image metadata and validate that is has
all of the required data set. Before this change Packer core would fail
if there is extra metadata fields in the image metadata that Packer is
not aware.
This change removes the restriction of erroring on unused metadata
fields. Packer should only care about the fields it knows and ignore the
rest. In the future, we will add new fields to the SDK but plugins may
begin sending that data sooner.
* refactor(website): use prop and CSS for plugin label spacing
* fix: add official tier label to built-in plugin docs
* feat(website): add BadgesHeader component
* refactor(website): use BadgesHeader in all content
* feat(website): add HCP ready demo, tweak badge look
* refactor: integrate work from add-plugin-version branch
* fix(website): correct bad import
* fix: use updated MDX custom component
* chore: remove plugin version label work from this branch
* chore: remove unused var
* fix: use new BadgesHeader interface for dual tags
* chore: remove unused var, refine comment
* fix: remove unused broken import
* fix: shorten property for HCP packer readiness
* Apply suggestions from code review
Remove a few demo labels before merging
Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
This change sets a region on the test datasource config to fix intermittent InvalidAMIID.NotFound errors.
Closes https://github.com/hashicorp/packer-internal-issues/issues/14
Failing results before change
```
> AWS_DEFAULT_REGION=us-west-1 make testacc
=== RUN TestAccInitAndBuildBasicAmazonAmiDatasource
2021/12/07 20:40:05 [INFO] AWS Auth provider used: "SharedCredentialsProvider"
2021/12/07 20:40:05 Found region us-west-1
2021/12/07 20:40:05 [INFO] AWS Auth provider used: "SharedCredentialsProvider"
pluginacc.go:143: Error running plugin acceptance tests: Bad exit code. Logfile: packer_log_amazon-ami_basic_datasource_test.txt
Logs can be found at /Users/wilkenrivera/Development/packer/acctest/plugin/packer_log_amazon-ami_basic_datasource_test.txt
and the acceptance test template can be found at /Users/wilkenrivera/Development/packer/acctest/plugin/amazon-ami_basic_datasource_test.pkr.hcl
--- FAIL: TestAccInitAndBuildBasicAmazonAmiDatasource (9.87s)
FAIL
FAIL github.com/hashicorp/packer/acctest/plugin 10.326s
```
Passing results after change
```
> AWS_DEFAULT_REGION=us-west-1 make testacc
=== RUN TestAccInitAndBuildBasicAmazonAmiDatasource
2021/12/07 20:47:28 [INFO] AWS Auth provider used: "SharedCredentialsProvider"
2021/12/07 20:47:28 Found region us-west-1
2021/12/07 20:47:28 [INFO] AWS Auth provider used: "SharedCredentialsProvider"
--- PASS: TestAccInitAndBuildBasicAmazonAmiDatasource (223.32s)
PASS
```
The auto installation of external plugins via packer init only work for
HCL templates. Since we have not officially removed all plugins (slated
for 1.8.0) I am reverting this test change. Once 1.7.9 is released we
can begin removing plugins and optimizing the redirect experience for
JSON-only users.