Fix: Correct boot source options for OpenStack 90/68990/2
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Mon, 18 Oct 2021 23:51:39 +0000 (16:51 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 19 Oct 2021 00:00:19 +0000 (17:00 -0700)
If a VOLUME_SIZE option is not defined in the base cloud configuration
then the default OpenStack boot selection should be 'image' not
'volumeFromImage' otherwise we are unable to properly take advantage of
all options provided by an OpenStack cloud.

Change-Id: I76ae042d598c9f7fa1868d4ea6a3566f8c6b8115
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
jenkins-admin/create_jenkins_clouds_openstack_yaml.py
releasenotes/notes/default_openstack_boot-76a655138ca488b9.yaml [new file with mode: 0644]

index a1464a5..d342469 100755 (executable)
@@ -93,9 +93,10 @@ jenkins:
         slaveOptions:
           availabilityZone: {{ availability_zone }}
           bootSource:
-            volumeFromImage:
+            {{ image_type }}:
               name: {{ image_name }}
-              volumeSize: {{ volume_size }}
+{%- if image_type == "volumeFromImage"  %}
+              volumeSize: {{ volume_size }}{% endif %}
           fsRoot: {{ fs_root }}
           hardwareId: {{ hardware_id }}
 {%- if is_sandbox is defined %}
@@ -201,6 +202,11 @@ for index, _ in enumerate(cloud_config_final):
         value = lookuptable[value]
     section_cloud[key] = value
 
+    if "volume_size" not in section_cloud:
+        section_cloud.update(image_type="image")
+    else:
+        section_cloud.update(image_type="volumeFromImage")
+
 j2_template = Template(maintemplate)
 print(j2_template.render(section_cloud))
 
diff --git a/releasenotes/notes/default_openstack_boot-76a655138ca488b9.yaml b/releasenotes/notes/default_openstack_boot-76a655138ca488b9.yaml
new file mode 100644 (file)
index 0000000..a8f7a6c
--- /dev/null
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    The OpenStack JCasC yaml converter has learned how to properly
+    differentiate between volumeFromImage and image boot sources.