diff --git a/helm/hybrid-cloud-postgresql-operator-crds/Chart.yaml b/helm/hybrid-cloud-postgresql-operator-crds/Chart.yaml index 6785023..0bb2120 100644 --- a/helm/hybrid-cloud-postgresql-operator-crds/Chart.yaml +++ b/helm/hybrid-cloud-postgresql-operator-crds/Chart.yaml @@ -4,3 +4,5 @@ description: Installs the CRDs for the hybrid-cloud-postgresql-operator type: application version: 0.0.1 appVersion: "0.1.0" +sources: + - https://github.com/MaibornWolff/hybrid-cloud-postgresql-operator diff --git a/helm/hybrid-cloud-postgresql-operator/Chart.yaml b/helm/hybrid-cloud-postgresql-operator/Chart.yaml index 4d7e25a..32067d2 100644 --- a/helm/hybrid-cloud-postgresql-operator/Chart.yaml +++ b/helm/hybrid-cloud-postgresql-operator/Chart.yaml @@ -4,3 +4,5 @@ description: Installs the hybrid-cloud-postgresql-operator type: application version: 0.0.1 appVersion: "0.1.0" +sources: + - https://github.com/MaibornWolff/hybrid-cloud-postgresql-operator diff --git a/hybridcloud/backends/aws_aurora.py b/hybridcloud/backends/aws_aurora.py index a9c8b60..ea5be14 100644 --- a/hybridcloud/backends/aws_aurora.py +++ b/hybridcloud/backends/aws_aurora.py @@ -1,7 +1,6 @@ import time import kopf from .aws_base import AwsBackendBase, calculate_maintenance_window -from .pgclient import PostgresSQLClient from ..config import get_one_of, config_get from ..util.reconcile_helpers import field_from_spec diff --git a/hybridcloud/backends/aws_base.py b/hybridcloud/backends/aws_base.py index f04c405..d95fcd5 100644 --- a/hybridcloud/backends/aws_base.py +++ b/hybridcloud/backends/aws_base.py @@ -1,5 +1,3 @@ -import time -import kopf from .pgclient import PostgresSQLClient from ..util.aws import aws_client_rds from ..util.reconcile_helpers import field_from_spec @@ -52,6 +50,7 @@ def _pgclient(self, admin_credentials, dbname=None) -> PostgresSQLClient: weekdays = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] + def calculate_maintenance_window(spec): # ddd:hh24:mi-ddd:hh24:mi window = field_from_spec(spec, "maintenance.window") diff --git a/hybridcloud/backends/aws_rds.py b/hybridcloud/backends/aws_rds.py index 52d6569..692de9f 100644 --- a/hybridcloud/backends/aws_rds.py +++ b/hybridcloud/backends/aws_rds.py @@ -1,7 +1,6 @@ import time import kopf from .aws_base import AwsBackendBase, calculate_maintenance_window -from .pgclient import PostgresSQLClient from ..config import get_one_of, config_get from ..util.reconcile_helpers import field_from_spec diff --git a/hybridcloud/backends/azure_postgresql.py b/hybridcloud/backends/azure_postgresql.py index 154eca4..284e7c2 100644 --- a/hybridcloud/backends/azure_postgresql.py +++ b/hybridcloud/backends/azure_postgresql.py @@ -1,11 +1,10 @@ -from logging import warning from azure.core.exceptions import ResourceNotFoundError -from azure.mgmt.rdbms.postgresql.models import ServerForCreate, ServerPropertiesForDefaultCreate, ServerUpdateParameters, ServerVersion, Sku, StorageProfile, Database, Configuration, VirtualNetworkRule, FirewallRule from azure.mgmt.network.models import PrivateEndpoint, Subnet, PrivateLinkServiceConnection +from azure.mgmt.rdbms.postgresql.models import ServerForCreate, ServerPropertiesForDefaultCreate, ServerUpdateParameters, ServerVersion, Sku, StorageProfile, Database, Configuration, VirtualNetworkRule, FirewallRule from azure.mgmt.resource.locks.models import ManagementLockObject from .pgclient import PostgresSQLClient -from ..util.azure import azure_client_locks, azure_client_postgres, azure_client_network, azure_client_privatedns from ..config import get_one_of, config_get +from ..util.azure import azure_client_locks, azure_client_postgres, azure_client_network, azure_client_privatedns from ..util.reconcile_helpers import field_from_spec diff --git a/hybridcloud/backends/azure_postgresqlflexible.py b/hybridcloud/backends/azure_postgresqlflexible.py index 0ee67d4..889b36f 100644 --- a/hybridcloud/backends/azure_postgresqlflexible.py +++ b/hybridcloud/backends/azure_postgresqlflexible.py @@ -4,8 +4,8 @@ from azure.mgmt.resource.locks.models import ManagementLockObject import kopf from .pgclient import PostgresSQLClient -from ..util.azure import azure_client_locks, azure_client_postgres_flexible, azure_client_network, azure_client_privatedns from ..config import get_one_of, config_get +from ..util.azure import azure_client_locks, azure_client_postgres_flexible, azure_client_network, azure_client_privatedns from ..util.reconcile_helpers import field_from_spec @@ -19,6 +19,7 @@ def _backend_config(key, default=None, fail_if_missing=False): IGNORE_RESET_PARAMETERS = [PRELOAD_PARAMETER, EXTENSIONS_PARAMETER] + def _calc_name(namespace, name): # Allow admins to override names so that existing storage accounts not following the schema can still be managed name_overrides = _backend_config("name_overrides", default=[]) diff --git a/hybridcloud/backends/helm_postgres.py b/hybridcloud/backends/helm_postgres.py index 7c989d1..42fc415 100644 --- a/hybridcloud/backends/helm_postgres.py +++ b/hybridcloud/backends/helm_postgres.py @@ -1,9 +1,7 @@ import os -import logging from .pgclient import PostgresSQLClient from ..config import config_get -from ..util import helm -from ..util import k8s +from ..util import helm, k8s from ..util.constants import HELM_BASE_PATH diff --git a/hybridcloud/backends/helm_yugabyte.py b/hybridcloud/backends/helm_yugabyte.py index 13ab726..e97bcc1 100644 --- a/hybridcloud/backends/helm_yugabyte.py +++ b/hybridcloud/backends/helm_yugabyte.py @@ -1,8 +1,7 @@ import os from .pgclient import PostgresSQLClient from ..config import config_get -from ..util import helm -from ..util import k8s +from ..util import helm, k8s from ..util.constants import HELM_BASE_PATH diff --git a/hybridcloud/handlers/postgresql_database.py b/hybridcloud/handlers/postgresql_database.py index ecbeee4..ac1fd97 100644 --- a/hybridcloud/handlers/postgresql_database.py +++ b/hybridcloud/handlers/postgresql_database.py @@ -2,11 +2,10 @@ import kopf from .routing import postgres_backend from ..config import config_get +from ..util import env, k8s +from ..util.constants import BACKOFF from ..util.password import generate_password from ..util.reconcile_helpers import process_action_label, ignore_control_label_change, determine_resource_password, shorten -from ..util import k8s -from ..util import env -from ..util.constants import BACKOFF def _tmp_secret(namespace, name): diff --git a/hybridcloud/handlers/postgresql_server.py b/hybridcloud/handlers/postgresql_server.py index 7acaf0a..a51bbdb 100644 --- a/hybridcloud/handlers/postgresql_server.py +++ b/hybridcloud/handlers/postgresql_server.py @@ -2,11 +2,10 @@ import kopf from .routing import postgres_backend from ..config import config_get +from ..util import env, k8s +from ..util.constants import BACKOFF from ..util.password import generate_password from ..util.reconcile_helpers import ignore_control_label_change, process_action_label, determine_resource_password, shorten -from ..util import k8s -from ..util import env -from ..util.constants import BACKOFF def _tmp_secret(namespace, name):