From 1fda67d9cd29ec6b348c69f8e0b55b5e4b91b266 Mon Sep 17 00:00:00 2001
From: jinyuan <liujinyuan@inspur.com>
Date: Mon, 19 Apr 2021 15:18:00 +0800
Subject: [PATCH] Fix the nova-compute-ironic label issue

The nova-compute-ironic label is "compute", but the label chosen by affinity is "compute-ironic", which results in multiple replicas on the same node.

Change-Id: If947be6cd400e32d3455f07a85f4263c4b17cb87
---
 nova/Chart.yaml                                | 2 +-
 nova/templates/statefulset-compute-ironic.yaml | 6 +++---
 releasenotes/notes/nova.yaml                   | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/nova/Chart.yaml b/nova/Chart.yaml
index f3e023cec0..487aec8bf3 100644
--- a/nova/Chart.yaml
+++ b/nova/Chart.yaml
@@ -14,7 +14,7 @@ apiVersion: v1
 appVersion: v1.0.0
 description: OpenStack-Helm Nova
 name: nova
-version: 0.1.17
+version: 0.1.18
 home: https://docs.openstack.org/nova/latest/
 icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png
 sources:
diff --git a/nova/templates/statefulset-compute-ironic.yaml b/nova/templates/statefulset-compute-ironic.yaml
index 042aa66b57..b400e203f8 100644
--- a/nova/templates/statefulset-compute-ironic.yaml
+++ b/nova/templates/statefulset-compute-ironic.yaml
@@ -28,17 +28,17 @@ metadata:
   annotations:
     {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
   labels:
-{{ tuple $envAll "nova" "compute" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
+{{ tuple $envAll "nova" "compute-ironic" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
 spec:
   replicas: {{ .Values.pod.replicas.compute_ironic }}
   selector:
     matchLabels:
-{{ tuple $envAll "nova" "compute" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
+{{ tuple $envAll "nova" "compute-ironic" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
   serviceName: "{{ tuple "baremetal" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}-compute"
   template:
     metadata:
       labels:
-{{ tuple $envAll "nova" "compute" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
+{{ tuple $envAll "nova" "compute-ironic" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
       annotations:
 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
         configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
diff --git a/releasenotes/notes/nova.yaml b/releasenotes/notes/nova.yaml
index 252c7bf181..a0197a9bff 100644
--- a/releasenotes/notes/nova.yaml
+++ b/releasenotes/notes/nova.yaml
@@ -18,3 +18,4 @@ nova:
   - 0.1.15 Mount /dev/pts in Nova compute container
   - 0.1.16 Use first IP address for migration
   - 0.1.17 Add multipathd support for ISCSI backed volume VMs
+  - 0.1.18 Fix the nova-compute-ironic label issue