From 5002bea34f0c50f7ced0ef64aca31fde874e9c88 Mon Sep 17 00:00:00 2001
From: Tadas Sutkaitis <tadasas@gmail.com>
Date: Wed, 27 Mar 2024 09:25:05 +0200
Subject: [PATCH] Keystone: Enable custom annotations

Enable custom annotations for pods [deployments, daemonsets]

Change-Id: I5dcc4dbf21b0079de5b503e54cd79196caf3a0b0
---
 keystone/Chart.yaml                        | 2 +-
 keystone/templates/deployment-api.yaml     | 1 +
 keystone/values_overrides/annotations.yaml | 9 +++++++++
 releasenotes/notes/keystone.yaml           | 1 +
 4 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 keystone/values_overrides/annotations.yaml

diff --git a/keystone/Chart.yaml b/keystone/Chart.yaml
index fb037b5544..3bb51cf3d9 100644
--- a/keystone/Chart.yaml
+++ b/keystone/Chart.yaml
@@ -14,7 +14,7 @@ apiVersion: v1
 appVersion: v1.0.0
 description: OpenStack-Helm Keystone
 name: keystone
-version: 0.3.7
+version: 0.3.8
 home: https://docs.openstack.org/keystone/latest/
 icon: https://www.openstack.org/themes/openstack/images/project-mascots/Keystone/OpenStack_Project_Keystone_vertical.png
 sources:
diff --git a/keystone/templates/deployment-api.yaml b/keystone/templates/deployment-api.yaml
index 978feb50ab..cff233b85b 100644
--- a/keystone/templates/deployment-api.yaml
+++ b/keystone/templates/deployment-api.yaml
@@ -50,6 +50,7 @@ spec:
 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
         configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
         configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
+{{ tuple "keystone_api" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
 {{ dict "envAll" $envAll "podName" "keystone-api" "containerNames" (list "keystone-api") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
     spec:
 {{ dict "envAll" $envAll "application" "keystone" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
diff --git a/keystone/values_overrides/annotations.yaml b/keystone/values_overrides/annotations.yaml
new file mode 100644
index 0000000000..2e6d7fcdde
--- /dev/null
+++ b/keystone/values_overrides/annotations.yaml
@@ -0,0 +1,9 @@
+---
+annotations:
+  pod:
+    default:
+      custom.tld/key: "value"
+      custom.tld/key2: "value2"
+    keystone_api:
+      another.tld/foo: "bar"
+...
diff --git a/releasenotes/notes/keystone.yaml b/releasenotes/notes/keystone.yaml
index cae533ab15..d0097081d4 100644
--- a/releasenotes/notes/keystone.yaml
+++ b/releasenotes/notes/keystone.yaml
@@ -54,4 +54,5 @@ keystone:
   - 0.3.5 Add 2023.2 Ubuntu Jammy overrides
   - 0.3.6 Use region option in keystone endpoint-update.py
   - 0.3.7 Make keystone TLS configuration granular
+  - 0.3.8 Enable custom annotations for Openstack pods
 ...