Skip to content

Commit

Permalink
Only allow keycloak integration with postgres backend
Browse files Browse the repository at this point in the history
  • Loading branch information
o-nikolas committed Oct 28, 2024
1 parent b84f881 commit f068bcd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 4 additions & 2 deletions dev/breeze/src/airflow_breeze/global_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
ALLOWED_ARCHITECTURES = [Architecture.X86_64, Architecture.ARM]
# Database Backends used when starting Breeze. The "none" value means that invalid configuration
# Is set and no database started - access to a database will fail.
ALLOWED_BACKENDS = ["sqlite", "mysql", "postgres", "none"]
POSTGRES_BACKEND = "postgres"
ALLOWED_BACKENDS = ["sqlite", "mysql", POSTGRES_BACKEND, "none"]
ALLOWED_PROD_BACKENDS = ["mysql", "postgres"]
DEFAULT_BACKEND = ALLOWED_BACKENDS[0]
CELERY_INTEGRATION = "celery"
Expand All @@ -85,7 +86,8 @@
DISABLE_TESTABLE_INTEGRATIONS_FROM_CI = [
"mssql",
]
OTHER_INTEGRATIONS = ["statsd", "otel", "openlineage", "keycloak"]
KEYCLOAK_INTEGRATION = "keycloak"
OTHER_INTEGRATIONS = ["statsd", "otel", "openlineage", KEYCLOAK_INTEGRATION]
ALLOWED_DEBIAN_VERSIONS = ["bookworm"]
ALL_INTEGRATIONS = sorted(
[
Expand Down
12 changes: 12 additions & 0 deletions dev/breeze/src/airflow_breeze/params/shell_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@
EDGE_EXECUTOR,
FASTAPI_API_HOST_PORT,
FLOWER_HOST_PORT,
KEYCLOAK_INTEGRATION,
MOUNT_ALL,
MOUNT_PROVIDERS_AND_TESTS,
MOUNT_REMOVE,
MOUNT_SELECTED,
MOUNT_TESTS,
MSSQL_HOST_PORT,
MYSQL_HOST_PORT,
POSTGRES_BACKEND,
POSTGRES_HOST_PORT,
REDIS_HOST_PORT,
SSH_PORT,
Expand Down Expand Up @@ -665,3 +667,13 @@ def __post_init__(self):
self.airflow_constraints_reference = self.default_constraints_branch
if self.providers_constraints_reference == "default":
self.providers_constraints_reference = self.default_constraints_branch

if (
self.backend
and self.integration
and not (self.backend == POSTGRES_BACKEND and KEYCLOAK_INTEGRATION in self.integration)
):
get_console().print(
"[error]When using the Keycloak integration the backend must be Postgres![/]\n"
)
sys.exit(2)
3 changes: 2 additions & 1 deletion scripts/ci/docker-compose/integration-keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ services:
- 38080:38080
restart: always
depends_on:
- postgres
postgres:
condition: service_healthy
volumes:
- ./keycloak/keycloak-entrypoint.sh:/opt/keycloak/keycloak-entrypoint.sh

Expand Down

0 comments on commit f068bcd

Please sign in to comment.