Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ See the fragment files in the [changelog.d/ directory](./changelog.d).

<!-- scriv-insert-here -->

<a id='changelog-21.2.1'></a>
## 21.2.1 — 2026-05-28

### Fixed

- Properly mirror the LMS caddy block in the default catch-all block used by `DRYDOCK_ENABLE_MULTITENANCY`.

- Avoid retriggering the CONFIG_LOADED action multiple times when redering the
jobs templates.

<a id='changelog-21.2.0'></a>
## 21.2.0 — 2026-04-24

Expand Down

This file was deleted.

19 changes: 13 additions & 6 deletions drydock/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from glob import glob

import click
from tutor import config as tutor_config
from tutor import env as tutor_env
from tutor import hooks as tutor_hooks
from tutor import serialize, types
Expand All @@ -17,6 +16,8 @@

INIT_JOBS_SYNC_WAVE = 1

TUTOR_CONFIG: types.Config = {}

tutor_hooks.Filters.CONFIG_DEFAULTS.add_items(
[
("DRYDOCK_VERSION", __version__),
Expand Down Expand Up @@ -59,6 +60,12 @@
)


@tutor_hooks.Actions.CONFIG_LOADED.add()
def _capture_config(config: types.Config) -> None:
global TUTOR_CONFIG
TUTOR_CONFIG = config


# This function is taken from
# https://github.com/overhangio/tutor/blob/v16.1.8/tutor/commands/k8s.py#L182
def _load_jobs(tutor_conf: types.Config) -> t.Iterable[t.Any]:
Expand All @@ -73,21 +80,21 @@ def _load_jobs(tutor_conf: types.Config) -> t.Iterable[t.Any]:
# and https://github.com/overhangio/tutor/blob/v16.1.8/tutor/commands/k8s.py#L82
def get_init_tasks():
"""Return the list of init tasks to run."""
if not TUTOR_CONFIG:
return []
init_tasks = list(tutor_hooks.Filters.CLI_DO_INIT_TASKS.iterate())
context = click.get_current_context().obj
tutor_conf = tutor_config.load(context.root)
jobs = tutor_conf.get("DRYDOCK_INIT_JOBS_EXCLUDED", [])
jobs = TUTOR_CONFIG.get("DRYDOCK_INIT_JOBS_EXCLUDED", [])
if not isinstance(jobs, list):
click.secho("'DRYDOCK_INIT_JOBS_EXCLUDED' must be a list. Ignoring.", fg="yellow")
jobs = []
excluded_init_jobs = set(jobs)

for i, (service, command) in enumerate(init_tasks):
for template in _load_jobs(tutor_conf):
for template in _load_jobs(TUTOR_CONFIG):
if template["metadata"]["name"] != service + "-job" or template["metadata"]["name"] in excluded_init_jobs:
continue

render_command = tutor_env.render_str(tutor_conf, command)
render_command = tutor_env.render_str(TUTOR_CONFIG, command)

template["metadata"]["name"] = "drydock-" + template["metadata"]["name"] + "-" + str(i)
template["metadata"]["labels"].update(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tutor-contrib-drydock"
version = "21.2.0"
version = "21.2.1"
description = "A Tutor plugin to manage our opinionated Open edX operations"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.