Skip to content

Commit

Permalink
fix: respect RUN_MYSQL on k8s maple upgrade
Browse files Browse the repository at this point in the history
During the maple -> nutmeg upgrade on k8s, only wait for mysql when RUN_MYSQL is true.
  • Loading branch information
CodeWithEmad authored Jan 9, 2023
1 parent d7bc337 commit b903c69
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Bugfix] Running `tutor k8s upgrade --from=maple` won't apply and won't wait for the MySQL deployment to be ready if `RUN_MYSQL: false` (When you host your MySQL somewhere else like RDS) (by @CodeWithEmad)
15 changes: 8 additions & 7 deletions tutor/commands/upgrade/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ def upgrade_from_maple(context: Context, config: Config) -> None:
# The environment needs to be updated because the backpopulate/backfill commands are from Nutmeg
tutor_env.save(context.root, config)

# Start mysql
k8s.kubectl_apply(
context.root,
"--selector",
"app.kubernetes.io/name=mysql",
)
k8s.wait_for_deployment_ready(config, "mysql")
if config["RUN_MYSQL"]:
# Start mysql
k8s.kubectl_apply(
context.root,
"--selector",
"app.kubernetes.io/name=mysql",
)
k8s.wait_for_deployment_ready(config, "mysql")

# lms upgrade
k8s.kubectl_apply(
Expand Down

0 comments on commit b903c69

Please sign in to comment.