Skip to content

Commit e662e28

Browse files
committed
fix sanitising of image name
1 parent 9bcc95f commit e662e28

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packer/openstack.pkr.hcl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ locals {
2424
git_commit = data.git-commit.cwd-head.hash
2525
timestamp = formatdate("YYMMDD-hhmm", timestamp())
2626
image_version = var.image_version == "auto" ? "${local.timestamp}-${substr(local.git_commit, 0, 8)}" : var.image_version
27-
image_name = replace(var.image_name, '/', '-')
2827
}
2928

3029
# Path pointing to root of repository - automatically set by environment variable PKR_VAR_repo_root
@@ -158,7 +157,7 @@ variable "inventory_groups" {
158157

159158
variable "image_name" {
160159
type = string
161-
description = "Built image name. Any '/' are replaced with '-'."
160+
description = "Built image name."
162161
default = "openhpc"
163162
}
164163

@@ -203,7 +202,7 @@ build {
203202

204203
source "source.openstack.openhpc" {
205204
name = "rocky-latest"
206-
image_name = join("-", [local.image_name, local.image_version])
205+
image_name = replace(join("-", [var.image_name, local.image_version]), "/", "-")
207206
}
208207

209208
provisioner "ansible" {

0 commit comments

Comments
 (0)