Skip to content

fix: let an instance's sql-data setting override the --sql-data flag - #2719

Open
anishmehta24 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
anishmehta24:fix/instance-sql-data-override
Open

anishmehta24 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
anishmehta24:fix/instance-sql-data-override

Conversation

@anishmehta24

Copy link
Copy Markdown

?sql-data=false on an instance is parsed into InstanceConnConfig.SQLDataEnabled, but the proxy checked instance is true || --sql-data, so with --sql-data set globally the instance still connected through SQL Data, got a Postgres port and skipped the cache warmup. private-ip and psc already let the instance value win over the flag; SQL Data now does the same.

Since SQL Data only supports Postgres, this is what you'd use to keep a MySQL instance on a normal connection next to Postgres ones:

./cloud-sql-proxy --sql-data proj:region:pg 'proj:region:mysql?sql-data=false'

Added a port selection case to TestClientInitialization and a case to TestSQLDataWarmup; both fail on main. Ran go test ./internal/proxy ./cmd on Linux (WSL).

@anishmehta24
anishmehta24 requested a review from a team as a code owner November 10, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants