-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Update Cloud SQL sample apps with SSL example #6777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Cloud SQL sample apps with SSL example #6777
Conversation
Here is the summary of changes. You are about to add 2 region tags.
This comment is generated by snippet-bot.
|
code LGTM so far, but we should figure out what's going on with the Python 3.10 build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified both MySQL and Postgres work. LGTM.
Would be nice to have a member of @GoogleCloudPlatform/python-samples-owners comment on the use of Python here. I personally don't see any issues, but don't know Python in and out.
cloud-sql/mysql/sqlalchemy/main.py
Outdated
return init_tcp_connection_engine(db_config) | ||
if os.environ.get("DB_ROOT_CERT"): | ||
return init_tcp_sslcerts_connection_engine(db_config) | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the else isn't needed here as we return, same for the other else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as suggested.
cloud-sql/mysql/sqlalchemy/main.py
Outdated
# otherwise use DB_PORT environment variable. | ||
host_args = db_host.split(":") | ||
if len(host_args) == 1: | ||
db_hostname = db_host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looked strange to me since we did the split but then didn't use it. Possibly could reduce that out as well
db_hostname = host_args[0] in both parts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use db_hostname = host_args[0] in both parts as suggested.
No description provided.