Skip to content

Commit e69980d

Browse files
committed
chore: update mysql ip types
1 parent 28f9979 commit e69980d

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.ci/cloudbuild.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ steps:
5151
nox -s system-${_VERSION}
5252
availableSecrets:
5353
secretManager:
54-
- versionName: "projects/$PROJECT_ID/secrets/MYSQL_CONNECTION_NAME/versions/latest"
54+
- versionName: "projects/$PROJECT_ID/secrets/MYSQL_PSA_CONNECTION_NAME/versions/latest"
5555
env: "MYSQL_CONNECTION_NAME"
56-
- versionName: "projects/$PROJECT_ID/secrets/MYSQL_USER/versions/latest"
56+
- versionName: "projects/$PROJECT_ID/secrets/MYSQL_PSA_USER/versions/latest"
5757
env: "MYSQL_USER"
5858
- versionName: "projects/$PROJECT_ID/secrets/CLOUD_BUILD_MYSQL_IAM_USER/versions/latest"
5959
env: "MYSQL_IAM_USER"
60-
- versionName: "projects/$PROJECT_ID/secrets/MYSQL_PASS/versions/latest"
60+
- versionName: "projects/$PROJECT_ID/secrets/MYSQL_PSA_PASS/versions/latest"
6161
env: "MYSQL_PASS"
6262
- versionName: "projects/$PROJECT_ID/secrets/MYSQL_DB/versions/latest"
6363
env: "MYSQL_DB"

tests/system/test_pymysql_connection.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ def test_pymysql_connection() -> None:
9696
db = os.environ["MYSQL_DB"]
9797
ip_type = os.environ.get("IP_TYPE", "public")
9898

99+
if ip_type == "private":
100+
ip_type = "psc"
101+
99102
engine, connector = create_sqlalchemy_engine(
100103
inst_conn_name, user, password, db, ip_type
101104
)
@@ -115,6 +118,9 @@ def test_lazy_pymysql_connection() -> None:
115118
db = os.environ["MYSQL_DB"]
116119
ip_type = os.environ.get("IP_TYPE", "public")
117120

121+
if ip_type == "private":
122+
ip_type = "psc"
123+
118124
engine, connector = create_sqlalchemy_engine(
119125
inst_conn_name, user, password, db, ip_type, "lazy"
120126
)

tests/system/test_pymysql_iam_auth.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ def test_pymysql_iam_authn_connection() -> None:
8888
db = os.environ["MYSQL_DB"]
8989
ip_type = os.environ.get("IP_TYPE", "public")
9090

91+
if ip_type == "private":
92+
ip_type = "psc"
93+
9194
engine, connector = create_sqlalchemy_engine(inst_conn_name, user, db, ip_type)
9295
with engine.connect() as conn:
9396
time = conn.execute(sqlalchemy.text("SELECT NOW()")).fetchone()
@@ -104,6 +107,9 @@ def test_lazy_pymysql_iam_authn_connection() -> None:
104107
db = os.environ["MYSQL_DB"]
105108
ip_type = os.environ.get("IP_TYPE", "public")
106109

110+
if ip_type == "private":
111+
ip_type = "psc"
112+
107113
engine, connector = create_sqlalchemy_engine(
108114
inst_conn_name, user, db, ip_type, "lazy"
109115
)

0 commit comments

Comments
 (0)