-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hcp packer registry build labels (#11401)
* Add basic support for build_labels argument * Update support for build_labels configuration argument * Update complete test-fixture with a build_labels configuration * Add test for deprecated labels argument * Add deprecation for hcp_packer_registry.labels When using the now deprecated labels argument of the new bucket_labels a Warning will be presented to the user. ``` ~> HCP_PACKER_BUILD_FINGERPRINT=356786543567865456789656789 packer build source.pkr.hcl Warning: the argument hcp_packer_registry.labels has been deprecated and will be removed in a future release; please use hcp_packer_registry.bucket_labels ``` When trying to use both bucket_labels and labels together an error is presented to the user. ``` ~> HCP_PACKER_BUILD_FINGERPRINT=ss6786543567865456789656789 packer build source.pkr.hcl Error: hcp_packer_registry.labels and hcp_packer_registry.bucket_labels are mutely exclusive; please use the recommended argument hcp_packer_registry.bucket_labels on source.pkr.hcl line 17: (source code not available) ``` * Update documentation for build_labels * Apply suggestions from code review Co-authored-by: Adrien Delorme <azr@users.noreply.github.com> * Update hcl2template/types.build.hcp_packer_registry.go Co-authored-by: Adrien Delorme <azr@users.noreply.github.com>
- Loading branch information
Showing
8 changed files
with
182 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
build { | ||
|
||
hcp_packer_registry { | ||
bucket_name = "bucket-slug" | ||
labels = { | ||
"foo" = "bar" | ||
} | ||
} | ||
|
||
sources = [ | ||
"source.virtualbox-iso.ubuntu-1204", | ||
] | ||
} | ||
|
||
source "virtualbox-iso" "ubuntu-1204" { | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ build { | |
description = <<EOT | ||
Some description | ||
EOT | ||
labels = { | ||
bucket_labels = { | ||
"foo" = "bar" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.