Skip to content
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

HCP Packer new data sources and nomenclature changes #726

Merged
merged 15 commits into from
Jan 24, 2024

Conversation

sylviamoss
Copy link
Contributor

@sylviamoss sylviamoss commented Jan 19, 2024

🛠️ Description

  • Migrate HCP Packer integration to HCP Packer API V2
  • Deprecate existing data sources and add new data sources
  • Deprecated existing resource attributes and new nomenclature replacements
  • Make necessary nomenclature changes in the verbiage and code base

🏗️ Acceptance tests

  • Are there any feature flags that are required to use this functionality?
  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAcc.*Packer.* -test.v'
==> Checking that code complies with gofmt requirements...
golangci-lint run --config ./golangci-config.yml
TF_ACC=1 go test ./internal/... -v -run=TestAcc.*Packer.* -test.v -timeout 360m -parallel=10
?   	github.com/hashicorp/terraform-provider-hcp/internal/clients/iampolicy	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/clients/packerv1	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/clients/packerv2	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/clients	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/consul	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/hcpvalidator	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/input	(cached) [no tests to run]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/acctest	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/customtypes	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/provider/iam	(cached) [no tests to run]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/provider/logstreaming	(cached) [no tests to run]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/configbuilder	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/configbuilder/packerconfig	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/testcheck	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/testclient	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils/base	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils/location	[no test files]
=== RUN   TestAcc_Packer_Data_Artifact
=== PAUSE TestAcc_Packer_Data_Artifact
=== RUN   TestAcc_Packer_Data_Artifact_InvalidInputs
=== PAUSE TestAcc_Packer_Data_Artifact_InvalidInputs
=== CONT  TestAcc_Packer_Data_Artifact
=== CONT  TestAcc_Packer_Data_Artifact_InvalidInputs
--- PASS: TestAcc_Packer_Data_Artifact_InvalidInputs (0.29s)
--- PASS: TestAcc_Packer_Data_Artifact (45.03s)
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/sources/artifact	(cached)
=== RUN   TestAcc_Packer_Data_Version_Simple
=== PAUSE TestAcc_Packer_Data_Version_Simple
=== RUN   TestAcc_Packer_Data_Version_InvalidInputs
=== PAUSE TestAcc_Packer_Data_Version_InvalidInputs
=== CONT  TestAcc_Packer_Data_Version_Simple
=== CONT  TestAcc_Packer_Data_Version_InvalidInputs
--- PASS: TestAcc_Packer_Data_Version_InvalidInputs (0.27s)
--- PASS: TestAcc_Packer_Data_Version_Simple (41.33s)
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/sources/version	(cached)
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/provider/resourcemanager	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/provider/vaultsecrets	(cached) [no tests to run]
=== RUN   TestAcc_dataSourcePackerBucketNames
--- PASS: TestAcc_dataSourcePackerBucketNames (12.94s)
=== RUN   TestAcc_dataSourcePackerImage_Simple
=== PAUSE TestAcc_dataSourcePackerImage_Simple
=== RUN   TestAcc_dataSourcePackerImage_IterationID
=== PAUSE TestAcc_dataSourcePackerImage_IterationID
=== RUN   TestAcc_dataSourcePackerImage_revokedIteration
=== PAUSE TestAcc_dataSourcePackerImage_revokedIteration
=== RUN   TestAcc_dataSourcePackerImage_emptyChannel
=== PAUSE TestAcc_dataSourcePackerImage_emptyChannel
=== RUN   TestAcc_dataSourcePackerImage_channelAndIterationIDReject
=== PAUSE TestAcc_dataSourcePackerImage_channelAndIterationIDReject
=== RUN   TestAcc_dataSourcePackerIteration_Simple
=== PAUSE TestAcc_dataSourcePackerIteration_Simple
=== RUN   TestAcc_dataSourcePackerIteration_revokedIteration
=== PAUSE TestAcc_dataSourcePackerIteration_revokedIteration
=== RUN   TestAcc_dataSourcePackerRunTask
--- PASS: TestAcc_dataSourcePackerRunTask (8.83s)
=== RUN   TestAccPackerChannelAssignment_SimpleSetUnset
=== PAUSE TestAccPackerChannelAssignment_SimpleSetUnset
=== RUN   TestAccPackerChannelAssignment_AssignLatest
=== PAUSE TestAccPackerChannelAssignment_AssignLatest
=== RUN   TestAccPackerChannelAssignment_InvalidInputs
=== PAUSE TestAccPackerChannelAssignment_InvalidInputs
=== RUN   TestAccPackerChannelAssignment_CreateFailsWhenPreassigned
=== PAUSE TestAccPackerChannelAssignment_CreateFailsWhenPreassigned
=== RUN   TestAccPackerChannelAssignment_HCPManagedChannelErrors
=== PAUSE TestAccPackerChannelAssignment_HCPManagedChannelErrors
=== RUN   TestAccPackerChannelAssignment_EnforceNull
=== PAUSE TestAccPackerChannelAssignment_EnforceNull
=== RUN   TestAccPackerChannelAssignment_AliasMigration
=== PAUSE TestAccPackerChannelAssignment_AliasMigration
=== RUN   TestAccPackerChannel
=== PAUSE TestAccPackerChannel
=== RUN   TestAccPackerChannel_HCPManaged
=== PAUSE TestAccPackerChannel_HCPManaged
=== RUN   TestAccPackerChannel_RestrictionDrift
=== PAUSE TestAccPackerChannel_RestrictionDrift
=== RUN   TestAccPackerChannel_RestrictionDriftHCPManaged
=== PAUSE TestAccPackerChannel_RestrictionDriftHCPManaged
=== RUN   TestAccPackerRunTask
--- PASS: TestAccPackerRunTask (19.98s)
=== CONT  TestAcc_dataSourcePackerImage_Simple
=== CONT  TestAccPackerChannelAssignment_InvalidInputs
=== CONT  TestAccPackerChannel
=== CONT  TestAccPackerChannel_RestrictionDrift
=== CONT  TestAccPackerChannel_HCPManaged
=== CONT  TestAccPackerChannelAssignment_EnforceNull
=== CONT  TestAccPackerChannelAssignment_AssignLatest
=== CONT  TestAccPackerChannelAssignment_AliasMigration
=== CONT  TestAccPackerChannelAssignment_HCPManagedChannelErrors
=== CONT  TestAccPackerChannelAssignment_CreateFailsWhenPreassigned
--- PASS: TestAccPackerChannelAssignment_InvalidInputs (3.84s)
=== CONT  TestAcc_dataSourcePackerImage_channelAndIterationIDReject
--- PASS: TestAcc_dataSourcePackerImage_channelAndIterationIDReject (0.24s)
=== CONT  TestAccPackerChannelAssignment_SimpleSetUnset
--- PASS: TestAccPackerChannelAssignment_HCPManagedChannelErrors (5.44s)
=== CONT  TestAcc_dataSourcePackerIteration_revokedIteration
--- PASS: TestAccPackerChannelAssignment_CreateFailsWhenPreassigned (10.44s)
=== CONT  TestAcc_dataSourcePackerIteration_Simple
--- PASS: TestAcc_dataSourcePackerImage_Simple (11.24s)
=== CONT  TestAcc_dataSourcePackerImage_revokedIteration
--- PASS: TestAcc_dataSourcePackerIteration_revokedIteration (6.62s)
=== CONT  TestAcc_dataSourcePackerImage_emptyChannel
--- PASS: TestAcc_dataSourcePackerImage_emptyChannel (2.43s)
=== CONT  TestAccPackerChannel_RestrictionDriftHCPManaged
--- PASS: TestAccPackerChannelAssignment_EnforceNull (15.21s)
=== CONT  TestAcc_dataSourcePackerImage_IterationID
--- PASS: TestAcc_dataSourcePackerImage_revokedIteration (5.94s)
--- PASS: TestAccPackerChannelAssignment_AssignLatest (18.03s)
--- PASS: TestAccPackerChannel (18.21s)
--- PASS: TestAccPackerChannelAssignment_AliasMigration (19.21s)
--- PASS: TestAccPackerChannelAssignment_SimpleSetUnset (15.21s)
--- PASS: TestAcc_dataSourcePackerIteration_Simple (8.86s)
--- PASS: TestAccPackerChannel_HCPManaged (20.13s)
--- PASS: TestAccPackerChannel_RestrictionDrift (20.28s)
--- PASS: TestAcc_dataSourcePackerImage_IterationID (6.26s)
--- PASS: TestAccPackerChannel_RestrictionDriftHCPManaged (19.38s)
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/providersdkv2	76.466s

...

@sylviamoss sylviamoss marked this pull request as ready for review January 19, 2024 17:55
@sylviamoss sylviamoss requested review from a team as code owners January 19, 2024 17:55
Copy link
Contributor

@JenGoldstrich JenGoldstrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM given past reviews on interim PRs, left one small comment!

```

```release-note:feature
`data.hcp_packer_version`: Added the `hcp_packer_version` data source, which replaces `data.hcp_packer_iteration`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit but maybe this should say "which will replace"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you think in the future because data.hcp_packer_iteration is still available? I would think that it is a replacement now because the added is deprecated from the time this PR is merged too. But I want to know your line of thought

Copy link
Contributor

@delores-hashicorp delores-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rubber stamping

@sylviamoss sylviamoss merged commit 64139a5 into main Jan 24, 2024
6 checks passed
@sylviamoss sylviamoss deleted the packer-nomenclature/main branch January 24, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants