Fix: If no volume set, use "image" type 85/68585/2
authorEric Ball <eball@linuxfoundation.org>
Thu, 19 Aug 2021 19:02:44 +0000 (12:02 -0700)
committerEric Ball <eball@linuxfoundation.org>
Thu, 19 Aug 2021 20:28:16 +0000 (13:28 -0700)
If no volume_size is defined, the default behavior was to set one to
10GB. However, the proper way to handle this is to use an "Image"
boot source rather than "Volume From Image".

Change-Id: Ib4a33f224ea1044b076d965faa164686da071cc4
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
jenkins-admin/create_jenkins_clouds_openstack_yaml.py
releasenotes/notes/openstack-label-fix-f06f9a1424ef13c5.yaml [new file with mode: 0644]

index b200b75..ec11f45 100755 (executable)
@@ -100,9 +100,10 @@ machinetemplate = """\
             name: {{ name_prefix }}-{{ labels }}
             slaveOptions:
               bootSource:
-                volumeFromImage:
+                {{ image_type }}:
                   name: {{ image_name }}
-                  volumeSize: {{ volume_size }}
+{%- if image_type == "volumeFromImage"  %}
+                  volumeSize: {{ volume_size }}{% endif %}
 {%- if hardware_id  %}
               hardwareId: {{ hardware_id }}{% endif %}
 {%- if instance_cap %}
@@ -202,7 +203,9 @@ for section in config_parser_merged.sections():
 
         # Default volume size of 10
         if "volume_size" not in section_all_machines:
-            section_all_machines.update(volume_size="10")
+            section_all_machines.update(image_type="image")
+        else:
+            section_all_machines.update(image_type="volumeFromImage")
         if "labels" not in section_all_machines:
             # "section" is the name of the cloud agent, which is the default label
             section_all_machines.update(labels=section)
diff --git a/releasenotes/notes/openstack-label-fix-f06f9a1424ef13c5.yaml b/releasenotes/notes/openstack-label-fix-f06f9a1424ef13c5.yaml
new file mode 100644 (file)
index 0000000..215f4f8
--- /dev/null
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    If no volume_size is defined, the default behavior was to set one to
+    10GB. However, the proper way to handle this is to use an "Image"
+    boot source rather than "Volume From Image".