mirror of https://github.com/hashicorp/packer
Not validating the bucket's name during parse leads to configurations being marked as valid, even if the bucket name is not, which will fail during a real build afterwards. To avoid this problem and fail with an error as quickly as possible, we add a check during parsing, so that it gets reported for validate as well.pull/12827/head
parent
767005149c
commit
dff49df129
@ -0,0 +1,12 @@
|
||||
source "null" "test" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
build {
|
||||
name = "bucket-slug"
|
||||
hcp_packer_registry {
|
||||
bucket_name = "invalid_bucket"
|
||||
}
|
||||
|
||||
sources = ["null.test"]
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
source "null" "test" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
build {
|
||||
name = "bucket-slug"
|
||||
hcp_packer_registry {
|
||||
bucket_name = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
||||
}
|
||||
|
||||
sources = ["null.test"]
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
source "null" "test" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
build {
|
||||
name = "bucket-slug"
|
||||
hcp_packer_registry {
|
||||
bucket_name = "ok-Bucket-name-1"
|
||||
}
|
||||
|
||||
sources = ["null.test"]
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
source "null" "test" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
build {
|
||||
name = "bucket-slug"
|
||||
hcp_packer_registry {
|
||||
bucket_name = "ba"
|
||||
}
|
||||
|
||||
sources = ["null.test"]
|
||||
}
|
||||
Loading…
Reference in new issue