kokhlo opened a new pull request, #72785:
URL: https://github.com/apache/airflow/pull/72785
## Description
Adds a `sql_proxy_major_version` option to `CloudSqlProxyRunner` (default
`1` — behavior unchanged) that opts into running the **Cloud SQL Auth Proxy
v2** binary.
### Why
The runner is hard-wired to Auth Proxy v1:
`CLOUD_SQL_PROXY_DOWNLOAD_URL`/`CLOUD_SQL_PROXY_VERSION_DOWNLOAD_URL` point at
the v1 buckets, and `_build_command_line_parameters()` emits `-dir` and
`-instances`, both removed in v2. v1 **cannot complete `caching_sha2_password`
full authentication** — on Cloud SQL for MySQL 8.4 (where it is the default and
`mysql_native_password` is unavailable, ERROR 4052) the first connection after
a server restart, failover or maintenance event fails with `1045 Access
denied`. Auth Proxy v1 no longer receives development; its startup banner
recommends v2.
Reported in #72681.
### What changes
- `sql_proxy_major_version=2` builds the v2 command line: `--unix-socket
<dir>` + positional instance connection name, `--auto-iam-authn` when
`sql_proxy_enable_iam_login` is set.
- v2 downloads come from GitHub releases
(`GoogleCloudPlatform/cloud-sql-proxy`), validated by a v2-specific version
regex; an explicit `sql_proxy_version` is **required** in v2 mode (no legacy
'latest' alias exists for the new binary layout).
- `start_proxy` also accepts the v2 ready-line ("ready to accept new
connections") alongside the v1 one.
- Unknown major versions are rejected with a clear error.
### Tests
6 new unit tests in
`providers/google/tests/unit/google/cloud/hooks/test_cloud_sql.py` (v2 command
line, IAM mapping, download URL, v1-style version rejection, version
requirement, unknown major version rejection).
```
TestCloudSqlProxyRunner (all, incl. 6 new) .... 18 passed
full file ..................................... 132 passed, 6 env-related
failures identical on clean main (baseline-verified via git stash)
```
## Related
Closes #72681
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]