diff --git a/src/charm_helpers.py b/src/charm_helpers.py index 9dbdd64..07fbbf6 100644 --- a/src/charm_helpers.py +++ b/src/charm_helpers.py @@ -40,14 +40,13 @@ def create_env(model_name, app_name, container_name, config, state): secret_persistence = config["secret-persistence"].value # Some defaults are extracted from Helm chart: - # https://github.com/airbytehq/airbyte-platform/tree/v0.60.0/charts/airbyte + # https://github.com/airbytehq/airbyte-platform/tree/v1.1.0/charts/airbyte env = { **BASE_ENV, # Airbye services config "LOG_LEVEL": config["log-level"].value, "TEMPORAL_HOST": config["temporal-host"], "WEBAPP_URL": config["webapp-url"], - "WORKLOAD_API_HOST": f"{app_name}:{WORKLOAD_API_PORT}", # Secrets config "SECRET_PERSISTENCE": secret_persistence, "SECRET_STORE_GCP_PROJECT_ID": config["secret-store-gcp-project-id"], @@ -139,11 +138,17 @@ def create_env(model_name, app_name, container_name, config, state): "CONNECTOR_BUILDER_SERVER_API_HOST": f"{app_name}:{CONNECTOR_BUILDER_SERVER_API_PORT}", "CONNECTOR_BUILDER_API_HOST": f"{app_name}:{CONNECTOR_BUILDER_SERVER_API_PORT}", "AIRBYTE_API_HOST": f"{app_name}:{AIRBYTE_API_PORT}/api/public", + "WORKLOAD_API_HOST": f"{app_name}:{WORKLOAD_API_PORT}", } # https://github.com/airbytehq/airbyte/issues/29506#issuecomment-1775148609 if container_name == "airbyte-workload-launcher": - env.update({"INTERNAL_API_HOST": f"http://{app_name}:{INTERNAL_API_PORT}"}) + env.update( + { + "INTERNAL_API_HOST": f"http://{app_name}:{INTERNAL_API_PORT}", + "WORKLOAD_API_HOST": f"http://{app_name}:{WORKLOAD_API_PORT}", + } + ) if config["storage-type"].value == StorageType.minio and state.minio: minio_endpoint = construct_svc_endpoint( diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index b229160..5b04ba9 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -416,8 +416,10 @@ def create_plan(container_name, storage_type): }, } - if container_name == "airbyte-api-server": - want_plan["services"][container_name]["environment"].update({"INTERNAL_API_HOST": "http://airbyte-k8s:8001"}) + if container_name == "airbyte-workload-launcher": + want_plan["services"][container_name]["environment"].update( + {"INTERNAL_API_HOST": "http://airbyte-k8s:8001", "WORKLOAD_API_HOST": "http://airbyte-k8s:8007"} + ) if storage_type == StorageType.minio: want_plan["services"][container_name]["environment"].update(