Skip to content
Snippets Groups Projects
Verified Commit 8c476eef authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

fix mariadb persistence

parent f0abbd50
No related branches found
No related tags found
No related merge requests found
...@@ -7,9 +7,10 @@ data: ...@@ -7,9 +7,10 @@ data:
values.yaml: | values.yaml: |
auth: auth:
rootPassword: '${database_root_password}' rootPassword: '${database_root_password}'
persistence: primary:
enabled: true persistence:
existingClaim: single-sign-on-database enabled: true
existingClaim: single-sign-on-database
initdbScripts: initdbScripts:
setup.sql: | setup.sql: |
CREATE USER hydra IDENTIFIED BY '${hydra_database_password}'; CREATE USER hydra IDENTIFIED BY '${hydra_database_password}';
......
...@@ -24,6 +24,7 @@ import yaml ...@@ -24,6 +24,7 @@ import yaml
from kubernetes import client, config from kubernetes import client, config
from kubernetes.client.exceptions import ApiException from kubernetes.client.exceptions import ApiException
from kubernetes.utils import create_from_yaml from kubernetes.utils import create_from_yaml
from kubernetes.utils.create_from_yaml import FailToCreateError
# This script gets called with an app name as argument. Most of them need an # This script gets called with an app name as argument. Most of them need an
# oauth client in Hydra, but some don't. This list contains the ones that # oauth client in Hydra, but some don't. This list contains the ones that
...@@ -161,10 +162,15 @@ def store_kubernetes_secret(secret_dict, namespace, update=False): ...@@ -161,10 +162,15 @@ def store_kubernetes_secret(secret_dict, namespace, update=False):
api_response = patch_kubernetes_secret(secret_dict, namespace) api_response = patch_kubernetes_secret(secret_dict, namespace)
else: else:
verb = "created" verb = "created"
api_response = create_from_yaml( try:
api_client, api_response = create_from_yaml(
yaml_objects=[secret_dict], api_client,
namespace=namespace) yaml_objects=[secret_dict],
namespace=namespace)
except FailToCreateError as ex:
print(f"Secret not {verb} because of exception {ex}")
return
print(f"Secret {verb} with api response: {api_response}") print(f"Secret {verb} with api response: {api_response}")
def patch_kubernetes_secret(secret_dict, namespace): def patch_kubernetes_secret(secret_dict, namespace):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment