fix(neutron): sync paste config

* fix(chart): Import paste.deploy patch and bump chart versions to latest

* Remove paste.deploy config override

* Remove paste.deploy config override for nova and neutron

* Add ovn_metadata image

* Remove orig file and update gitignore

* fix typo in gitignore

---------

Co-authored-by: okozachenko1203 <okozachenko1203@users.noreply.github.com>
diff --git a/charts/glance/Chart.yaml b/charts/glance/Chart.yaml
index 0650294..c0837b8 100644
--- a/charts/glance/Chart.yaml
+++ b/charts/glance/Chart.yaml
@@ -9,4 +9,4 @@
 sources:
 - https://opendev.org/openstack/glance
 - https://opendev.org/openstack/openstack-helm
-version: 0.4.1
+version: 0.4.6
diff --git a/charts/glance/charts/helm-toolkit/Chart.yaml b/charts/glance/charts/helm-toolkit/Chart.yaml
index c1296b9..7d3703e 100644
--- a/charts/glance/charts/helm-toolkit/Chart.yaml
+++ b/charts/glance/charts/helm-toolkit/Chart.yaml
@@ -9,4 +9,4 @@
 sources:
 - https://opendev.org/openstack/openstack-helm-infra
 - https://opendev.org/openstack/openstack-helm
-version: 0.2.51
+version: 0.2.53
diff --git a/charts/glance/charts/helm-toolkit/templates/scripts/_db-init.py.tpl b/charts/glance/charts/helm-toolkit/templates/scripts/_db-init.py.tpl
index 4294d40..6027b95 100644
--- a/charts/glance/charts/helm-toolkit/templates/scripts/_db-init.py.tpl
+++ b/charts/glance/charts/helm-toolkit/templates/scripts/_db-init.py.tpl
@@ -133,8 +133,10 @@
 # Create DB User
 try:
     root_engine.execute(
-        "GRANT ALL ON `{0}`.* TO \'{1}\'@\'%%\' IDENTIFIED BY \'{2}\' {3}".format(
-            database, user, password, mysql_x509))
+        "CREATE USER IF NOT EXISTS \'{0}\'@\'%%\' IDENTIFIED BY \'{1}\' {2}".format(
+            user, password, mysql_x509))
+    root_engine.execute(
+        "GRANT ALL ON `{0}`.* TO \'{1}\'@\'%%\'".format(database, user))
     logger.info("Created user {0} for {1}".format(user, database))
 except:
     logger.critical("Could not create user {0} for {1}".format(user, database))
diff --git a/charts/glance/charts/helm-toolkit/templates/scripts/db-backup-restore/_backup_main.sh.tpl b/charts/glance/charts/helm-toolkit/templates/scripts/db-backup-restore/_backup_main.sh.tpl
index 9597d34..3963bd4 100644
--- a/charts/glance/charts/helm-toolkit/templates/scripts/db-backup-restore/_backup_main.sh.tpl
+++ b/charts/glance/charts/helm-toolkit/templates/scripts/db-backup-restore/_backup_main.sh.tpl
@@ -214,7 +214,7 @@
   fi
 
   # load balance delay
-  DELAY=$((1 + ${RANDOM} % 300))
+  DELAY=$((1 + ${RANDOM} % 30))
   echo "Sleeping for ${DELAY} seconds to spread the load in time..."
   sleep ${DELAY}
 
@@ -231,31 +231,17 @@
     return 2
   fi
 
-  # load balance delay
-  DELAY=$((1 + ${RANDOM} % 300))
-  echo "Sleeping for ${DELAY} seconds to spread the load in time..."
-  sleep ${DELAY}
-
-  # Calculation remote file SHA256 hash
-  REMOTE_FILE=$(mktemp -p /tmp)
-  openstack object save --file ${REMOTE_FILE} $CONTAINER_NAME $FILE
-  if [[ $? -ne 0 ]]; then
-    log WARN "${DB_NAME}_backup" "Unable to save container object $FILE for SHA256 hash verification."
-    rm -rf ${REMOTE_FILE}
-    return 1
-  fi
-
   # Remote backup verification
-  SHA256_REMOTE=$(cat ${REMOTE_FILE} | sha256sum | awk '{print $1}')
-  SHA256_LOCAL=$(cat ${FILEPATH}/${FILE} | sha256sum | awk '{print $1}')
-  log INFO "${DB_NAME}_backup" "Calculated SHA256 hashes for the file $FILE in container $CONTAINER_NAME."
-  log INFO "${DB_NAME}_backup" "Local SHA256 hash is ${SHA256_LOCAL}."
-  log INFO "${DB_NAME}_backup" "Remote SHA256 hash is ${SHA256_REMOTE}."
-  if [[ "${SHA256_LOCAL}" == "${SHA256_REMOTE}" ]]; then
-      log INFO "${DB_NAME}_backup" "The local backup & remote backup SHA256 hash values are matching for file $FILE in container $CONTAINER_NAME."
+  MD5_REMOTE=$(openstack object show $CONTAINER_NAME $FILE -f json | jq -r ".etag")
+  MD5_LOCAL=$(cat ${FILEPATH}/${FILE} | md5sum | awk '{print $1}')
+  log INFO "${DB_NAME}_backup" "Obtained MD5 hash for the file $FILE in container $CONTAINER_NAME."
+  log INFO "${DB_NAME}_backup" "Local MD5 hash is ${MD5_LOCAL}."
+  log INFO "${DB_NAME}_backup" "Remote MD5 hash is ${MD5_REMOTE}."
+  if [[ "${MD5_LOCAL}" == "${MD5_REMOTE}" ]]; then
+      log INFO "${DB_NAME}_backup" "The local backup & remote backup MD5 hash values are matching for file $FILE in container $CONTAINER_NAME."
   else
-      log ERROR "${DB_NAME}_backup" "Mismatch between the local backup & remote backup sha256 hash values"
-      return 1
+      log ERROR "${DB_NAME}_backup" "Mismatch between the local backup & remote backup MD5 hash values"
+      return 2
   fi
   rm -rf ${REMOTE_FILE}
 
diff --git a/charts/glance/requirements.lock b/charts/glance/requirements.lock
index 2b3071d..7829be4 100644
--- a/charts/glance/requirements.lock
+++ b/charts/glance/requirements.lock
@@ -1,6 +1,6 @@
 dependencies:
 - name: helm-toolkit
   repository: file://../../openstack-helm-infra/helm-toolkit
-  version: 0.2.51
-digest: sha256:9fe05ff9103d825422e13cdd8ce9852c3dacfadc12751b7883affdbe483b1b3b
-generated: "2023-01-30T23:10:00.834718332Z"
+  version: 0.2.53
+digest: sha256:f8f4fbba6f638b79447f7e458933b07deb792ae30a14df5900bde542cf0e64a6
+generated: "2023-05-16T04:42:18.575234198Z"
diff --git a/charts/glance/templates/bin/_storage-init.sh.tpl b/charts/glance/templates/bin/_storage-init.sh.tpl
index cf6fecb..0d291fd 100644
--- a/charts/glance/templates/bin/_storage-init.sh.tpl
+++ b/charts/glance/templates/bin/_storage-init.sh.tpl
@@ -49,7 +49,7 @@
     if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -ge 12 ]]; then
         ceph osd pool application enable $1 $3
     fi
-    ceph osd pool set "$1" size "${RBD_POOL_REPLICATION}"
+    ceph osd pool set "$1" size "${RBD_POOL_REPLICATION}" --yes-i-really-mean-it
     ceph osd pool set "$1" crush_rule "${RBD_POOL_CRUSH_RULE}"
   }
   ensure_pool "${RBD_POOL_NAME}" "${RBD_POOL_CHUNK_SIZE}" "${RBD_POOL_APP_NAME}"
diff --git a/charts/glance/templates/configmap-etc.yaml b/charts/glance/templates/configmap-etc.yaml
index 0ee2606..277cea4 100644
--- a/charts/glance/templates/configmap-etc.yaml
+++ b/charts/glance/templates/configmap-etc.yaml
@@ -55,6 +55,10 @@
 {{- $_ := set .Values.conf.glance.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
 {{- end -}}
 
+{{- if not .Values.conf.paste }}
+{{- $_ := set $envAll.Values.conf.glance.paste_deploy "config_file" "/var/lib/openstack/etc/glance/glance-api-paste.ini" -}}
+{{- end }}
+
 {{- if empty .Values.conf.glance.database.connection -}}
 {{- $connection := tuple "oslo_db" "internal" "glance" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
 {{- if .Values.manifests.certificates -}}
@@ -142,7 +146,9 @@
   rally_tests.yaml: {{ toYaml .Values.conf.rally_tests.tests | b64enc }}
   glance-api.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.glance | b64enc }}
   logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }}
+  {{- if .Values.conf.paste }}
   glance-api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }}
+  {{- end }}
   policy.yaml: {{ toYaml .Values.conf.policy | b64enc }}
   api_audit_map.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.api_audit_map | b64enc }}
   glance_sudoers: {{ $envAll.Values.conf.glance_sudoers | b64enc }}
diff --git a/charts/glance/templates/deployment-api.yaml b/charts/glance/templates/deployment-api.yaml
index 9c26c74..dc641c5 100644
--- a/charts/glance/templates/deployment-api.yaml
+++ b/charts/glance/templates/deployment-api.yaml
@@ -210,10 +210,12 @@
               subPath: {{ base .Values.conf.glance.DEFAULT.log_config_append }}
               readOnly: true
             {{- end }}
+            {{- if .Values.conf.paste }}
             - name: glance-etc
               mountPath: /etc/glance/glance-api-paste.ini
               subPath: glance-api-paste.ini
               readOnly: true
+            {{- end }}
             - name: glance-etc
               mountPath: /etc/glance/policy.yaml
               subPath: policy.yaml
diff --git a/charts/glance/templates/job-bootstrap.yaml b/charts/glance/templates/job-bootstrap.yaml
index 56bebfc..c1af58d 100644
--- a/charts/glance/templates/job-bootstrap.yaml
+++ b/charts/glance/templates/job-bootstrap.yaml
@@ -39,5 +39,11 @@
 {{- if .Values.pod.tolerations.glance.enabled -}}
 {{- $_ := set $bootstrapJob "tolerationsEnabled" true -}}
 {{- end -}}
+# The configFile path shouble be /etc/glance/glance-api.conf
+# not default /etc/glance/glance.conf defined by helm-toolkit,
+# since secrets mounted in '/etc/glance' have glance-api.conf not glance.conf in it.
+# The wrong path '/etc/glance/glance.conf' would be dir in bootstarp container,
+# and lead to all config files in '/etc/glance' dir unreachable.
+{{- $_ := set $bootstrapJob "configFile" "/etc/glance/glance-api.conf" -}}
 {{ $bootstrapJob | include "helm-toolkit.manifests.job_bootstrap" }}
 {{- end }}
diff --git a/charts/glance/values.yaml b/charts/glance/values.yaml
index 69f703e..cea5248 100644
--- a/charts/glance/values.yaml
+++ b/charts/glance/values.yaml
@@ -129,66 +129,7 @@
   ceph_client:
     override:
     append:
-  paste:
-    pipeline:glance-api:
-      pipeline: cors healthcheck http_proxy_to_wsgi versionnegotiation osprofiler unauthenticated-context rootapp
-    pipeline:glance-api-caching:
-      pipeline: cors healthcheck http_proxy_to_wsgi versionnegotiation osprofiler unauthenticated-context cache rootapp
-    pipeline:glance-api-cachemanagement:
-      pipeline: cors healthcheck http_proxy_to_wsgi versionnegotiation osprofiler unauthenticated-context cache cachemanage rootapp
-    pipeline:glance-api-keystone:
-      pipeline: cors healthcheck http_proxy_to_wsgi versionnegotiation osprofiler authtoken audit context  rootapp
-    pipeline:glance-api-keystone+caching:
-      pipeline: cors healthcheck http_proxy_to_wsgi versionnegotiation osprofiler authtoken audit context cache rootapp
-    pipeline:glance-api-keystone+cachemanagement:
-      pipeline: cors healthcheck http_proxy_to_wsgi versionnegotiation osprofiler authtoken audit context cache cachemanage rootapp
-    pipeline:glance-api-trusted-auth:
-      pipeline: cors healthcheck http_proxy_to_wsgi versionnegotiation osprofiler context rootapp
-    pipeline:glance-api-trusted-auth+cachemanagement:
-      pipeline: cors healthcheck http_proxy_to_wsgi versionnegotiation osprofiler context cache cachemanage rootapp
-    composite:rootapp:
-      paste.composite_factory: glance.api:root_app_factory
-      /: apiversions
-      /v1: apiv1app
-      /v2: apiv2app
-    app:apiversions:
-      paste.app_factory: glance.api.versions:create_resource
-    app:apiv1app:
-      paste.app_factory: glance.api.v1.router:API.factory
-    app:apiv2app:
-      paste.app_factory: glance.api.v2.router:API.factory
-    filter:healthcheck:
-      paste.filter_factory: oslo_middleware:Healthcheck.factory
-      backends: disable_by_file
-      disable_by_file_path: /etc/glance/healthcheck_disable
-    filter:versionnegotiation:
-      paste.filter_factory: glance.api.middleware.version_negotiation:VersionNegotiationFilter.factory
-    filter:cache:
-      paste.filter_factory: glance.api.middleware.cache:CacheFilter.factory
-    filter:cachemanage:
-      paste.filter_factory: glance.api.middleware.cache_manage:CacheManageFilter.factory
-    filter:context:
-      paste.filter_factory: glance.api.middleware.context:ContextMiddleware.factory
-    filter:unauthenticated-context:
-      paste.filter_factory: glance.api.middleware.context:UnauthenticatedContextMiddleware.factory
-    filter:authtoken:
-      paste.filter_factory: keystonemiddleware.auth_token:filter_factory
-      delay_auth_decision: true
-    filter:audit:
-      paste.filter_factory: keystonemiddleware.audit:filter_factory
-      audit_map_file: /etc/glance/api_audit_map.conf
-    filter:gzip:
-      paste.filter_factory: glance.api.middleware.gzip:GzipMiddleware.factory
-    filter:osprofiler:
-      paste.filter_factory: osprofiler.web:WsgiMiddleware.factory
-      hmac_keys: SECRET_KEY  # DEPRECATED
-      enabled: yes  # DEPRECATED
-    filter:cors:
-      paste.filter_factory: oslo_middleware.cors:filter_factory
-      oslo_config_project: glance
-      oslo_config_program: glance-api
-    filter:http_proxy_to_wsgi:
-      paste.filter_factory: oslo_middleware:HTTPProxyToWSGI.factory
+  paste: {}
   policy: {}
   glance_sudoers: |
     # This sudoers file supports rootwrap for both Kolla and LOCI Images.
@@ -258,6 +199,7 @@
       auth_type: password
       auth_version: v3
       memcache_security_strategy: ENCRYPT
+      service_type: image
     glance_store:
       cinder_catalog_info: volumev3::internalURL
       rbd_store_chunk_size: 8
@@ -840,6 +782,9 @@
       - key: node-role.kubernetes.io/master
         operator: Exists
         effect: NoSchedule
+      - key: node-role.kubernetes.io/control-plane
+        operator: Exists
+        effect: NoSchedule
   useHostNetwork:
     api: false
   mounts: