Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ATMOSPHERE-188] feat: support SQLAlchemy 2.0 #1622

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
openstack_helm_dependencies: &openstack_helm_dependencies
- name: helm-toolkit
repository: https://tarballs.openstack.org/openstack-helm-infra
version: 0.2.64
version: 0.2.69

charts:
- name: barbican
Expand Down Expand Up @@ -86,7 +86,7 @@ charts:
repository:
url: https://charts.bitnami.com/bitnami
- name: keystone
version: 0.3.5
version: 0.3.15
repository: *openstack_helm_repository
dependencies: *openstack_helm_dependencies
patches:
Expand Down
2 changes: 1 addition & 1 deletion charts/barbican/charts/helm-toolkit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ name: helm-toolkit
sources:
- https://opendev.org/openstack/openstack-helm-infra
- https://opendev.org/openstack/openstack-helm
version: 0.2.64
version: 0.2.69
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ return: |
{{- $endpointScheme := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }}
{{- $userMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "auth" $userclass }}
{{- $endpointUser := index $userMap "username" }}
{{- $endpointPass := index $userMap "password" }}
{{- $endpointPass := index $userMap "password" | urlquery }}
{{- $endpointHost := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $endpointPath := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ examples:
{{- $ssMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "statefulset" | default false}}
{{- $hostFqdnOverride := index $context.Values.endpoints ( $type | replace "-" "_" ) "host_fqdn_override" }}
{{- $endpointUser := index $userMap "username" }}
{{- $endpointPass := index $userMap "password" }}
{{- $endpointPass := index $userMap "password" | urlquery }}
{{- $endpointHostSuffix := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $local := dict "endpointCredsAndHosts" list -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,25 @@ except:

# Delete DB
try:
root_engine.execute("DROP DATABASE IF EXISTS {0}".format(database))
with root_engine.connect() as connection:
connection.execute("DROP DATABASE IF EXISTS {0}".format(database))
try:
connection.commit()
except AttributeError:
pass
logger.info("Deleted database {0}".format(database))
except:
logger.critical("Could not drop database {0}".format(database))
raise

# Delete DB User
try:
root_engine.execute("DROP USER IF EXISTS {0}".format(user))
with root_engine.connect() as connection:
connection.execute("DROP USER IF EXISTS {0}".format(user))
try:
connection.commit()
except AttributeError:
pass
logger.info("Deleted user {0}".format(user))
except:
logger.critical("Could not delete user {0}".format(user))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,29 @@ except:

# Create DB
try:
root_engine.execute("CREATE DATABASE IF NOT EXISTS {0}".format(database))
with root_engine.connect() as connection:
connection.execute("CREATE DATABASE IF NOT EXISTS {0}".format(database))
try:
connection.commit()
except AttributeError:
pass
logger.info("Created database {0}".format(database))
except:
logger.critical("Could not create database {0}".format(database))
raise

# Create DB User
try:
root_engine.execute(
"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))
with root_engine.connect() as connection:
connection.execute(
"CREATE USER IF NOT EXISTS \'{0}\'@\'%%\' IDENTIFIED BY \'{1}\' {2}".format(
user, password, mysql_x509))
connection.execute(
"GRANT ALL ON `{0}`.* TO \'{1}\'@\'%%\'".format(database, user))
try:
connection.commit()
except AttributeError:
pass
logger.info("Created user {0} for {1}".format(user, database))
except:
logger.critical("Could not create user {0} for {1}".format(user, database))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ values: |
images:
tags:
test_image: docker.io/port/test:version-foo
image_foo: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
image_foo: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal
pull_policy: IfNotPresent
local_registry:
active: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract: |
values: |
images:
tags:
dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
dep_check: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal
pull_policy: IfNotPresent
local_registry:
active: true
Expand Down Expand Up @@ -76,7 +76,7 @@ usage: |
{{ tuple . "calico_node" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" }}
return: |
- name: init
image: "quay.io/airshipit/kubernetes-entrypoint:v1.0.0"
image: "quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal"
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
Expand Down
4 changes: 2 additions & 2 deletions charts/barbican/requirements.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: helm-toolkit
repository: https://tarballs.openstack.org/openstack-helm-infra
version: 0.2.64
digest: sha256:4c00b9bfa1d3dc0426a82ec22f51b440e838c55cbd1f81dbf7de5b28471f6141
version: 0.2.69
digest: sha256:f971f98746c97193da5ff7a44d2401ae7d91201a49ed9f23d52359a1b6e9d0ef
generated: '0001-01-01T00:00:00Z'
2 changes: 1 addition & 1 deletion charts/barbican/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies:
- name: helm-toolkit
repository: https://tarballs.openstack.org/openstack-helm-infra
version: 0.2.64
version: 0.2.69
2 changes: 1 addition & 1 deletion charts/ceph-provisioners/charts/helm-toolkit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ name: helm-toolkit
sources:
- https://opendev.org/openstack/openstack-helm-infra
- https://opendev.org/openstack/openstack-helm
version: 0.2.64
version: 0.2.69
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ return: |
{{- $endpointScheme := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }}
{{- $userMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "auth" $userclass }}
{{- $endpointUser := index $userMap "username" }}
{{- $endpointPass := index $userMap "password" }}
{{- $endpointPass := index $userMap "password" | urlquery }}
{{- $endpointHost := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $endpointPath := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ examples:
{{- $ssMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "statefulset" | default false}}
{{- $hostFqdnOverride := index $context.Values.endpoints ( $type | replace "-" "_" ) "host_fqdn_override" }}
{{- $endpointUser := index $userMap "username" }}
{{- $endpointPass := index $userMap "password" }}
{{- $endpointPass := index $userMap "password" | urlquery }}
{{- $endpointHostSuffix := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $local := dict "endpointCredsAndHosts" list -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,25 @@ except:

# Delete DB
try:
root_engine.execute("DROP DATABASE IF EXISTS {0}".format(database))
with root_engine.connect() as connection:
connection.execute("DROP DATABASE IF EXISTS {0}".format(database))
try:
connection.commit()
except AttributeError:
pass
logger.info("Deleted database {0}".format(database))
except:
logger.critical("Could not drop database {0}".format(database))
raise

# Delete DB User
try:
root_engine.execute("DROP USER IF EXISTS {0}".format(user))
with root_engine.connect() as connection:
connection.execute("DROP USER IF EXISTS {0}".format(user))
try:
connection.commit()
except AttributeError:
pass
logger.info("Deleted user {0}".format(user))
except:
logger.critical("Could not delete user {0}".format(user))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,29 @@ except:

# Create DB
try:
root_engine.execute("CREATE DATABASE IF NOT EXISTS {0}".format(database))
with root_engine.connect() as connection:
connection.execute("CREATE DATABASE IF NOT EXISTS {0}".format(database))
try:
connection.commit()
except AttributeError:
pass
logger.info("Created database {0}".format(database))
except:
logger.critical("Could not create database {0}".format(database))
raise

# Create DB User
try:
root_engine.execute(
"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))
with root_engine.connect() as connection:
connection.execute(
"CREATE USER IF NOT EXISTS \'{0}\'@\'%%\' IDENTIFIED BY \'{1}\' {2}".format(
user, password, mysql_x509))
connection.execute(
"GRANT ALL ON `{0}`.* TO \'{1}\'@\'%%\'".format(database, user))
try:
connection.commit()
except AttributeError:
pass
logger.info("Created user {0} for {1}".format(user, database))
except:
logger.critical("Could not create user {0} for {1}".format(user, database))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ values: |
images:
tags:
test_image: docker.io/port/test:version-foo
image_foo: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
image_foo: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal
pull_policy: IfNotPresent
local_registry:
active: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract: |
values: |
images:
tags:
dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
dep_check: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal
pull_policy: IfNotPresent
local_registry:
active: true
Expand Down Expand Up @@ -76,7 +76,7 @@ usage: |
{{ tuple . "calico_node" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" }}
return: |
- name: init
image: "quay.io/airshipit/kubernetes-entrypoint:v1.0.0"
image: "quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal"
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
Expand Down
4 changes: 2 additions & 2 deletions charts/ceph-provisioners/requirements.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: helm-toolkit
repository: https://tarballs.openstack.org/openstack-helm-infra
version: 0.2.64
digest: sha256:4c00b9bfa1d3dc0426a82ec22f51b440e838c55cbd1f81dbf7de5b28471f6141
version: 0.2.69
digest: sha256:f971f98746c97193da5ff7a44d2401ae7d91201a49ed9f23d52359a1b6e9d0ef
generated: '0001-01-01T00:00:00Z'
2 changes: 1 addition & 1 deletion charts/ceph-provisioners/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies:
- name: helm-toolkit
repository: https://tarballs.openstack.org/openstack-helm-infra
version: 0.2.64
version: 0.2.69
2 changes: 1 addition & 1 deletion charts/cinder/charts/helm-toolkit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ name: helm-toolkit
sources:
- https://opendev.org/openstack/openstack-helm-infra
- https://opendev.org/openstack/openstack-helm
version: 0.2.64
version: 0.2.69
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ return: |
{{- $endpointScheme := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }}
{{- $userMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "auth" $userclass }}
{{- $endpointUser := index $userMap "username" }}
{{- $endpointPass := index $userMap "password" }}
{{- $endpointPass := index $userMap "password" | urlquery }}
{{- $endpointHost := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $endpointPath := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ examples:
{{- $ssMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "statefulset" | default false}}
{{- $hostFqdnOverride := index $context.Values.endpoints ( $type | replace "-" "_" ) "host_fqdn_override" }}
{{- $endpointUser := index $userMap "username" }}
{{- $endpointPass := index $userMap "password" }}
{{- $endpointPass := index $userMap "password" | urlquery }}
{{- $endpointHostSuffix := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $local := dict "endpointCredsAndHosts" list -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,25 @@ except:

# Delete DB
try:
root_engine.execute("DROP DATABASE IF EXISTS {0}".format(database))
with root_engine.connect() as connection:
connection.execute("DROP DATABASE IF EXISTS {0}".format(database))
try:
connection.commit()
except AttributeError:
pass
logger.info("Deleted database {0}".format(database))
except:
logger.critical("Could not drop database {0}".format(database))
raise

# Delete DB User
try:
root_engine.execute("DROP USER IF EXISTS {0}".format(user))
with root_engine.connect() as connection:
connection.execute("DROP USER IF EXISTS {0}".format(user))
try:
connection.commit()
except AttributeError:
pass
logger.info("Deleted user {0}".format(user))
except:
logger.critical("Could not delete user {0}".format(user))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,29 @@ except:

# Create DB
try:
root_engine.execute("CREATE DATABASE IF NOT EXISTS {0}".format(database))
with root_engine.connect() as connection:
connection.execute("CREATE DATABASE IF NOT EXISTS {0}".format(database))
try:
connection.commit()
except AttributeError:
pass
logger.info("Created database {0}".format(database))
except:
logger.critical("Could not create database {0}".format(database))
raise

# Create DB User
try:
root_engine.execute(
"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))
with root_engine.connect() as connection:
connection.execute(
"CREATE USER IF NOT EXISTS \'{0}\'@\'%%\' IDENTIFIED BY \'{1}\' {2}".format(
user, password, mysql_x509))
connection.execute(
"GRANT ALL ON `{0}`.* TO \'{1}\'@\'%%\'".format(database, user))
try:
connection.commit()
except AttributeError:
pass
logger.info("Created user {0} for {1}".format(user, database))
except:
logger.critical("Could not create user {0} for {1}".format(user, database))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ values: |
images:
tags:
test_image: docker.io/port/test:version-foo
image_foo: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
image_foo: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal
pull_policy: IfNotPresent
local_registry:
active: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract: |
values: |
images:
tags:
dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
dep_check: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal
pull_policy: IfNotPresent
local_registry:
active: true
Expand Down Expand Up @@ -76,7 +76,7 @@ usage: |
{{ tuple . "calico_node" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" }}
return: |
- name: init
image: "quay.io/airshipit/kubernetes-entrypoint:v1.0.0"
image: "quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal"
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
Expand Down
Loading