|
9 | 9 | import typing # noqa: F401 |
10 | 10 | import sys |
11 | 11 |
|
| 12 | +from ydb.library.yql.providers.common.proto.gateways_config_pb2 import TGenericConnectorConfig |
12 | 13 | from ydb.tests.library.common import yatest_common |
13 | 14 | from ydb.tests.library.harness.kikimr_cluster import kikimr_cluster_factory |
14 | 15 | from ydb.tests.library.harness.kikimr_config import KikimrConfigGenerator |
@@ -255,6 +256,24 @@ def enable_tls(): |
255 | 256 | return os.getenv('YDB_GRPC_ENABLE_TLS') == 'true' |
256 | 257 |
|
257 | 258 |
|
| 259 | +def generic_connector_config(): |
| 260 | + endpoint = os.getenv("FQ_CONNECTOR_ENDPOINT") |
| 261 | + if not endpoint: |
| 262 | + return None |
| 263 | + |
| 264 | + split = endpoint.split(':') |
| 265 | + if len(split) != 2: |
| 266 | + raise ValueError("Invalid FQ_CONNECTOR_ENDPOINT: '{}'".format(endpoint)) |
| 267 | + |
| 268 | + cfg = TGenericConnectorConfig() |
| 269 | + print(dir(cfg)) |
| 270 | + cfg.Endpoint.host = split[0] |
| 271 | + cfg.Endpoint.port = int(split[1]) |
| 272 | + # TODO: pass extra env variable to enable TLS |
| 273 | + cfg.UseSsl = False |
| 274 | + return cfg |
| 275 | + |
| 276 | + |
258 | 277 | def grpc_tls_data_path(arguments): |
259 | 278 | default_store = arguments.ydb_working_dir if arguments.ydb_working_dir else None |
260 | 279 | return os.getenv('YDB_GRPC_TLS_DATA_PATH', default_store) |
@@ -338,6 +357,7 @@ def deploy(arguments): |
338 | 357 | default_users=default_users(), |
339 | 358 | extra_feature_flags=enable_feature_flags, |
340 | 359 | extra_grpc_services=arguments.enabled_grpc_services, |
| 360 | + generic_connector_config=generic_connector_config(), |
341 | 361 | **optionals |
342 | 362 | ) |
343 | 363 |
|
|
0 commit comments