From: Anil Belur Date: Tue, 5 Jun 2018 02:14:58 +0000 (+1000) Subject: Expand rendered image name to include sec and ms X-Git-Tag: v0.1.0~27^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=c0dc5f030e259b70533a4d626eae5ab176fdd560;p=releng%2Fcommon-packer.git Expand rendered image name to include sec and ms Expand rendered image name to include seconds and milliseconds. This reduces the probability of image name clashes in the env. The initial change Ic1853ba7566def397b8bce389e2779fe3020c7ce was reverted, since the change had issues bringing up an instance on the OpenStack cloud provider. This was because the default `instance_name` value is taken as the `image_name`, when the instance_name is unset, the instance_name does not allow FQDN format hostname ending with a period+number. The workaround is to use separate `instance_name` parameter in your builder which does not end with period+number. Tested the change to work: "ZZCI - CentOS 7 - docker - 20180605-015801.089" JIRA: RELENG-971 Change-Id: Ia195bd99d55f23b4f39acf590520637e54fc006a Signed-off-by: Anil Belur --- diff --git a/templates/builder-aws.json b/templates/builder-aws.json index 9a6b621..e136e70 100644 --- a/templates/builder-aws.json +++ b/templates/builder-aws.json @@ -20,7 +20,8 @@ { "name": "aws", "access_key": "{{user `aws_access_key`}}", - "ami_name": "ZZCI - {{user `distro`}} - builder-aws - {{isotime \"20060102-1504\"}}", + "ami_name": "ZZCI - {{user `distro`}} - builder-aws - {{isotime \"20060102-150405.000\"}}", + "instance_name": "{{user `distro`}}-builder-aws-{{uuid}}", "instance_type": "{{user `aws_instance_type`}}", "region": "{{user `aws_region`}}", "secret_key": "{{user `aws_secret_key`}}", diff --git a/templates/builder.json b/templates/builder.json index 7c4ce3f..2b0fcb5 100644 --- a/templates/builder.json +++ b/templates/builder.json @@ -15,7 +15,8 @@ "builders": [ { "name": "vexxhost", - "image_name": "ZZCI - {{user `distro`}} - builder - {{isotime \"20060102-1504\"}}", + "image_name": "ZZCI - {{user `distro`}} - builder - {{isotime \"20060102-150405.000\"}}", + "instance_name": "{{user `distro`}}-builder-{{uuid}}", "source_image_name": "{{user `base_image`}}", "type": "openstack", "identity_endpoint": "{{user `cloud_auth_url`}}", diff --git a/templates/docker.json b/templates/docker.json index 01fe021..02a5407 100644 --- a/templates/docker.json +++ b/templates/docker.json @@ -15,7 +15,8 @@ "builders": [ { "name": "vexxhost", - "image_name": "ZZCI - {{user `distro`}} - docker - {{isotime \"20060102-1504\"}}", + "image_name": "ZZCI - {{user `distro`}} - docker - {{isotime \"20060102-150405.000\"}}", + "instance_name": "{{user `distro`}}-docker-{{uuid}}", "source_image_name": "{{user `base_image`}}", "type": "openstack", "identity_endpoint": "{{user `cloud_auth_url`}}",