Skip to content

Registry cache install task fails with the cache off: loop value must resolve to a list #71

Open

Description

@Mearman

With the registry cache off (the default), running the github_runner_arc role fails at Registry cache: install the cache in roles/github_runner_arc/tasks/install_registry_cache.yml with:

The `loop` value must resolve to a 'list', not 'dict'.

The task sits in a block guarded by when: github_runner_arc_registry_cache_enabled | bool, but Ansible templates a task's loop before it evaluates when, so the guard never stops the loop from being resolved. The loop is github_runner_arc_registry_cache_resources, which tasks/render_registry_cache.yml only sets as a fact when the cache is on. With it off, the name resolves to the role default in defaults/main.yml, the container requests and limits dict, and the loop fails. The same name is therefore used for two different things: the container resources setting and the list of rendered manifests.

It is not specific to --check: it reproduces in a normal run and in check mode, on ansible-core 2.21.4, against a stand-in for kubernetes.core. Seen on release v1.26.1.

Fix: give the rendered manifests their own variable so the default can never be looped over, and cover the install tasks with the cache off and on, in both modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions