fix(service-role-loader): loop on a variable of its own #62
No reviewers
Labels
No labels
bug
cannot reproduce
duplicate
enhancement
help wanted
invalid
need info
need triage
need verification
not a bug
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
claudiomaradonna/castrum!62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/loader-loop-var"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
service-role-loaderincludes each service role a host switches on. Itdid so in a loop on Ansible's default
item. A loaded role whose own taskloops also binds
item, so every run through the loader warnedThe loop variable 'item' is already in use. The user's--check --diffrun of
fortify.ymlshowed it atcontainer-prune, andzramandtraefik-routesloop the same way. A role task that read the loader'sitemwould also get its own loop's value instead.What changed
The loader's include loop now binds
service_role_loader_role, soitemstays with the roles it loads. Which roles load, the refusal ofactive_services, and thealwaystag that lets a tagged run reachthe loaded roles are unchanged.
The
retired_servicesgate now also loadscontainer-prunethroughthe loader under
--checkand fails on the warning. Its fixture playand its CONTRIBUTING row say so.
How to verify
Prerequisites: the Setup toolchain. Base
main(
a5c49f5); branchfix/loader-loop-var(eba5441)../tests/gates/check_retired_services.shpasses on the branch. Onmainit fails with "the loader's loop variable collides with aloaded role's loop".
mainand none on thebranch:
ansible-playbook -i tests/fixtures/local.yml tests/fixtures/retired_services/playbook.yml --check --tags container-prune -e container_prune_enabled=true -e docker_engine_enabled=truemake checkpasses../tests/gates/check_tag_propagation.sh, whichneeds podman, passes on the branch:
--tags zramstill reacheszramthrough the loader.Considerations
retired_servicesname although it now coversthe loop variable too. Renaming it would touch the Makefile and the
gate table without helping anyone reading them.
Command failed
The agent did not complete this command, so nothing came of it. A person should look at this thread.
The run failed at step "aoe_purge". The operator reads the job logs in the Windmill editor, or finds the run with:
wmill job list --path f/agents/bot_commands