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

HPR-1512: Deprecate to-be-removed Iteration attributes #678

Merged
merged 3 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changelog/678.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:deprecation
The `data.hcp_packer_iteration.incremental_version` attribute is now deprecated and will be removed in a future release. Use the `fingerprint`, `id` or `uuid` attributes to reference iterations instead.
```

```release-note:deprecation
The `hcp_packer_channel_assignment.iteration_version` attribute is now deprecated and will be removed in a future release. Use the `iteration_fingerprint` attribute to reference iterations instead.
```

```release-note:deprecation
The `hcp_packer_channel_assignment.iteration_id` attribute is now deprecated and will be removed in a future release. Use the `iteration_fingerprint` attribute to reference iterations instead.
```
2 changes: 1 addition & 1 deletion docs/data-sources/packer_iteration.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If a project is not configured in the HCP Provider config block, the oldest proj
- `created_at` (String) Creation time of this iteration
- `fingerprint` (String) The unique fingerprint associated with this iteration; often a git sha.
- `id` (String) The ID of this resource.
- `incremental_version` (Number) Incremental version of this iteration
- `incremental_version` (Number, Deprecated) Incremental version of this iteration
- `organization_id` (String) The ID of the organization this HCP Packer registry is located in.
- `revoke_at` (String) The revocation time of this iteration. This field will be null for any iteration that has not been revoked or scheduled for revocation.
- `ulid` (String) The ULID of this iteration.
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/packer_channel_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ resource "hcp_packer_channel_assignment" "staging" {
### Optional

- `iteration_fingerprint` (String) The fingerprint of the iteration assigned to the channel.
- `iteration_id` (String) The ID of the iteration assigned to the channel.
- `iteration_version` (Number) The incremental version of the iteration assigned to the channel.
- `iteration_id` (String, Deprecated) The ID of the iteration assigned to the channel.
- `iteration_version` (Number, Deprecated) The incremental version of the iteration assigned to the channel.
- `project_id` (String) The ID of the HCP project where the channel is located.
If not specified, the project specified in the HCP Provider config block will be used, if configured.
If a project is not configured in the HCP Provider config block, the oldest project in the organization will be used.
Expand Down
1 change: 1 addition & 0 deletions internal/providersdkv2/data_source_packer_iteration.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ If a project is not configured in the HCP Provider config block, the oldest proj
Description: "Incremental version of this iteration",
Type: schema.TypeInt,
Computed: true,
Deprecated: "This attribute will be removed in a future version. Use `fingerprint` to reference iterations instead.",
},
"created_at": {
Description: "Creation time of this iteration",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ If a project is not configured in the HCP Provider config block, the oldest proj
Computed: true,
ExactlyOneOf: []string{"iteration_id", "iteration_fingerprint", "iteration_version"},
ValidateFunc: validation.StringIsNotEmpty,
Deprecated: "This attribute will be removed in a future version. Use `iteration_fingerprint` to reference iterations instead.",
},
"iteration_version": {
Description: "The incremental version of the iteration assigned to the channel.",
Expand All @@ -90,6 +91,7 @@ If a project is not configured in the HCP Provider config block, the oldest proj
Computed: true,
ExactlyOneOf: []string{"iteration_id", "iteration_fingerprint", "iteration_version"},
ValidateFunc: validation.IntBetween(0, math.MaxInt32),
Deprecated: "This attribute will be removed in a future version. Use `iteration_fingerprint` to reference iterations instead.",
},
// Computed Values
"organization_id": {
Expand Down