run-fleet.sh logs a different worker name than the container gets when EXTRA_ENV sets ORCH_WORKER_NAME

Open Beginner friendly
#32 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, shell
Domain
cli, devops

Research direction

Read setup-scripts/debian13-worker/lib.sh around load_env (lines 380-385) and stamp_worker_env (lines 689-693), then inspect the related bats tests and CHANGELOG. Add coverage for EXTRA_ENV containing ORCH_WORKER_NAME and check the existing warning pattern. Done means the warning names the key and effective value without printing other EXTRA_ENV content, while behavior without that setting stays unchanged.

Written by the indexing model from the issue text.

Description

bug client P3

Problem

ORCH_WORKER_NAME can appear twice in a stamped env.N. stamp_worker_env writes it once (setup-scripts/debian13-worker/lib.sh:689). If the operator also puts it in EXTRA_ENV, that block is appended after it (lib.sh:690-693).

podman run --env-file keeps the last occurrence, so the container runs with the EXTRA_ENV name. But run-fleet.sh reads the first one (setup-scripts/debian13-worker/run-fleet.sh:160, sed ... | head -n1), then logs and preserves it. The log says one name and the worker registers under another.

The same happens when an operator appends a second name line to env.N by hand: make up applies it, and the next rerun of run-fleet.sh reverts it.

load_env already warns when the disk gate keys appear in both channels (lib.sh:380-385), but it does not do that for ORCH_WORKER_NAME.

Steps to reproduce

  1. Set EXTRA_ENV="ORCH_WORKER_NAME=fromextra" in setup.env.
  2. Run run-fleet.sh.
  3. The log shows Worker 1/3 (<prefix>-1), but the container runs as fromextra.

Proposed change

Warn in load_env when EXTRA_ENV contains ORCH_WORKER_NAME, in the same way as for the disk gate keys. The warning names the key and tells the operator which value the container will use. It does not print other EXTRA_ENV content.

Do not switch run-fleet.sh to read the last occurrence. That would rename already enrolled workers on the server at the next rerun.

Acceptance criteria

  • With ORCH_WORKER_NAME in EXTRA_ENV, the operator gets a warning that names the key and the effective value.
  • Without it, behavior and output are unchanged. Existing deployments keep working without config changes, and enrolled workers keep their names.
  • A bats test with ORCH_WORKER_NAME in EXTRA_ENV pins the warning.
  • CHANGELOG entry under Unreleased.
Dominant language
Python
Stars
0
Forks
0
Avg merge
1d 1h
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AInvirion/orcaster

All issues in AInvirion/orcaster

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.