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

Update ReadFromHCLBuildBlock to use the hcp_packer_registry.Description #12235

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

nywilken
Copy link
Contributor

In packer v1.8.5, the bucket's description was not properly set in the
bucket object we use for HCP, therefore all the buckets created by
Packer did not have their description updated.

Before the change

--- FAIL: TestReadFromHCLBuildBlock (0.00s)
    --- FAIL: TestReadFromHCLBuildBlock/configure_bucket_using_only_hcp_packer_registry_block (0.00s)
        types.bucket_test.go:380: expected the build to to have contents of hcp_packer_registry block but it does not:   &registry.Bucket{
                Slug:         "hcp_packer_registry-block-test",
            -   Description:  "",
            +   Description:  "description from hcp_packer_registry block",
                Destination:  "",
                BucketLabels: {"org": "test"},
                ... // 5 identical fields
              }
FAIL
FAIL    github.com/hashicorp/packer/internal/hcp/registry       1.072s
FAIL

After Change

~>  go test ./...
?       github.com/hashicorp/packer/internal/hcp/api    [no test files]
ok      github.com/hashicorp/packer/internal/hcp/env    (cached)
ok      github.com/hashicorp/packer/internal/hcp/registry       1.130s

@nywilken nywilken requested a review from a team as a code owner January 30, 2023 19:16
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

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

Just left a naming suggestion regarding the build block, but aside from that the code looks good to me, :shipit: !

internal/hcp/registry/types.bucket.go Show resolved Hide resolved
In packer v1.8.5, the bucket's description was not properly set in the
bucket object we use for HCP, therefore all the buckets created by
Packer did not have their description updated.

Before the change
```
--- FAIL: TestReadFromHCLBuildBlock (0.00s)
    --- FAIL: TestReadFromHCLBuildBlock/configure_bucket_using_only_hcp_packer_registry_block (0.00s)
        types.bucket_test.go:380: expected the build to to have contents of hcp_packer_registry block but it does not:   &registry.Bucket{
                Slug:         "hcp_packer_registry-block-test",
            -   Description:  "",
            +   Description:  "description from hcp_packer_registry block",
                Destination:  "",
                BucketLabels: {"org": "test"},
                ... // 5 identical fields
              }
FAIL
FAIL    github.com/hashicorp/packer/internal/hcp/registry       1.072s
FAIL
```

After Change
```
~>  go test ./...
?       github.com/hashicorp/packer/internal/hcp/api    [no test files]
ok      github.com/hashicorp/packer/internal/hcp/env    (cached)
ok      github.com/hashicorp/packer/internal/hcp/registry       1.130s

```
@nywilken nywilken force-pushed the nywilken/fix-hcp-bucket-description branch from 3bb3702 to 56c1924 Compare January 30, 2023 21:08
@nywilken nywilken merged commit d880d1b into main Jan 30, 2023
@nywilken nywilken deleted the nywilken/fix-hcp-bucket-description branch January 30, 2023 21:18
@github-actions
Copy link

github-actions bot commented Mar 2, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants