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:
values.yaml: |
auth:
rootPassword: '${database_root_password}'
persistence:
enabled: true
existingClaim: single-sign-on-database
primary:
persistence:
enabled: true
existingClaim: single-sign-on-database
initdbScripts:
setup.sql: |
CREATE USER hydra IDENTIFIED BY '${hydra_database_password}';
......
......@@ -24,6 +24,7 @@ import yaml
from kubernetes import client, config
from kubernetes.client.exceptions import ApiException
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
# 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):
api_response = patch_kubernetes_secret(secret_dict, namespace)
else:
verb = "created"
api_response = create_from_yaml(
api_client,
yaml_objects=[secret_dict],
namespace=namespace)
try:
api_response = create_from_yaml(
api_client,
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}")
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