mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-01-07 07:54:03 +00:00
fix: "unexpected args" error on k8s
`kubectl_apply` was missing a "root" argument. Close #611.
This commit is contained in:
parent
8e052f703f
commit
f13c3db833
@ -4,6 +4,8 @@ Note: Breaking changes between versions are indicated by "💥".
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- [Bugfix] Fix "Unexpected args" error during service initialization on Kubernetes (#611).
|
||||||
|
|
||||||
## v13.1.6 (2022-03-15)
|
## v13.1.6 (2022-03-15)
|
||||||
|
|
||||||
- [Bugfix] Fix `local/k8s quickstart` commands when upgrading from an older release (#595).
|
- [Bugfix] Fix `local/k8s quickstart` commands when upgrading from an older release (#595).
|
||||||
|
@ -113,6 +113,7 @@ class K8sJobRunner(jobs.BaseJobRunner):
|
|||||||
# We cannot use the k8s API to create the job: configMap and volume names need
|
# We cannot use the k8s API to create the job: configMap and volume names need
|
||||||
# to be found with the right suffixes.
|
# to be found with the right suffixes.
|
||||||
kubectl_apply(
|
kubectl_apply(
|
||||||
|
self.root,
|
||||||
"--selector",
|
"--selector",
|
||||||
f"app.kubernetes.io/name={job_name}",
|
f"app.kubernetes.io/name={job_name}",
|
||||||
)
|
)
|
||||||
@ -232,27 +233,21 @@ def start(context: Context, names: List[str]) -> None:
|
|||||||
for name in names:
|
for name in names:
|
||||||
if name == "all":
|
if name == "all":
|
||||||
# Create volumes
|
# Create volumes
|
||||||
utils.kubectl(
|
kubectl_apply(
|
||||||
"apply",
|
context.root,
|
||||||
"--kustomize",
|
|
||||||
tutor_env.pathjoin(context.root),
|
|
||||||
"--wait",
|
"--wait",
|
||||||
"--selector",
|
"--selector",
|
||||||
"app.kubernetes.io/component=volume",
|
"app.kubernetes.io/component=volume",
|
||||||
)
|
)
|
||||||
# Create everything else except jobs
|
# Create everything else except jobs
|
||||||
utils.kubectl(
|
kubectl_apply(
|
||||||
"apply",
|
context.root,
|
||||||
"--kustomize",
|
|
||||||
tutor_env.pathjoin(context.root),
|
|
||||||
"--selector",
|
"--selector",
|
||||||
"app.kubernetes.io/component notin (job,volume,namespace)",
|
"app.kubernetes.io/component notin (job,volume,namespace)",
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
utils.kubectl(
|
kubectl_apply(
|
||||||
"apply",
|
context.root,
|
||||||
"--kustomize",
|
|
||||||
tutor_env.pathjoin(context.root),
|
|
||||||
"--selector",
|
"--selector",
|
||||||
f"app.kubernetes.io/name={name}",
|
f"app.kubernetes.io/name={name}",
|
||||||
)
|
)
|
||||||
|
@ -56,24 +56,20 @@ def initialise(runner: BaseJobRunner, limit_to: Optional[str] = None) -> None:
|
|||||||
if limit_to is None or limit_to == plugin_name:
|
if limit_to is None or limit_to == plugin_name:
|
||||||
for service in hook:
|
for service in hook:
|
||||||
fmt.echo_info(
|
fmt.echo_info(
|
||||||
"Plugin {}: running pre-init for service {}...".format(
|
f"Plugin {plugin_name}: running pre-init for service {service}..."
|
||||||
plugin_name, service
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
runner.run_job_from_template(
|
runner.run_job_from_template(
|
||||||
service, plugin_name, "hooks", service, "pre-init"
|
service, plugin_name, "hooks", service, "pre-init"
|
||||||
)
|
)
|
||||||
for service in ["lms", "cms"]:
|
for service in ["lms", "cms"]:
|
||||||
if limit_to is None or limit_to == service:
|
if limit_to is None or limit_to == service:
|
||||||
fmt.echo_info("Initialising {}...".format(service))
|
fmt.echo_info(f"Initialising {service}...")
|
||||||
runner.run_job_from_template(service, "hooks", service, "init")
|
runner.run_job_from_template(service, "hooks", service, "init")
|
||||||
for plugin_name, hook in runner.iter_plugin_hooks("init"):
|
for plugin_name, hook in runner.iter_plugin_hooks("init"):
|
||||||
if limit_to is None or limit_to == plugin_name:
|
if limit_to is None or limit_to == plugin_name:
|
||||||
for service in hook:
|
for service in hook:
|
||||||
fmt.echo_info(
|
fmt.echo_info(
|
||||||
"Plugin {}: running init for service {}...".format(
|
f"Plugin {plugin_name}: running init for service {service}..."
|
||||||
plugin_name, service
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
runner.run_job_from_template(
|
runner.run_job_from_template(
|
||||||
service, plugin_name, "hooks", service, "init"
|
service, plugin_name, "hooks", service, "init"
|
||||||
@ -136,9 +132,7 @@ site.themes.create(theme_dir_name='{theme_name}')
|
|||||||
""".format(
|
""".format(
|
||||||
theme_name=theme_name, domain_name=domain_name
|
theme_name=theme_name, domain_name=domain_name
|
||||||
)
|
)
|
||||||
command = BASE_OPENEDX_COMMAND + './manage.py lms shell -c "{python_code}"'.format(
|
command = BASE_OPENEDX_COMMAND + f'./manage.py lms shell -c "{python_code}"'
|
||||||
python_code=python_code
|
|
||||||
)
|
|
||||||
runner.run_job("lms", command)
|
runner.run_job("lms", command)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user