Skip to content

drift: flag release pins no transport reads - #2837

Merged
berendt merged 1 commit into
mainfrom
drift-release-pin-orphan
Oct 16, 2026
Merged

berendt merged 1 commit into
mainfrom
drift-release-pin-orphan

Conversation

@ideaship

@ideaship ideaship commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Adds an image-group drift plugin, release_pin_orphan, that flags every docker_images pin in latest/base.yml that no deployment reads.

A pin reaches a running container only through one of two templates, which the plugin calls the release transports:

  • the generics manager render (environments/manager/images.yml). render-images.py turns the pins into <alias>_tag/<alias>_image variables for the services on the manager node (ara-server, netbox, the manager's redis and postgres, osism, osism-ansible, ...).
  • osism-ansible's versions.yml.j2. When the osism-ansible image is built, render-versions.py bakes the pins into group_vars/all/versions.yml as <alias>_tag overrides for the services osism apply deploys (step-ca, homer, dnsmasq, squid, ...). A pin the template does not list never reaches the role, which then runs its default tag.

A pin that neither template references as versions['<key>'] influences no deployment; Renovate keeps bumping it, but nothing runs that tag. Kolla and Ceph images are not affected: their tags come from the Kolla image SBOM and latest/ceph-<series>.yml, not from docker_images.

The existing image_orphan plugin starts from the aliases the manager render emits, so it never sees a pin the render does not carry. The memcached pin went unnoticed for three years this way:

Four pins are allowlisted:

The three other pins it flagged when written (alerta, fleet, nexus) have been removed:

The drift job runs only in periodic-daily, so its findings never block a PR.

Tests: tox -e drift-test passes (1067 passed, 2 skipped). Run against main on 2026-10-16 with --plugin release_pin_orphan, it reports no findings, with 4 allowlisted and 0 stale entries.

🤖 Generated with Claude Code

image_orphan starts from the aliases that the generics manager render
emits. A pin in latest/base.yml that the render never carried is
therefore invisible to it. The memcached pin, left behind when the
patchman roles were removed, went unnoticed for three years because
of this (#2835).

Add an image-group plugin, release_pin_orphan, that starts from
base.yml instead. It flags every docker_images key that neither of the
two release transports reads:

- generics environments/manager/images.yml, for the manager
  environment, and
- container-image-osism-ansible files/src/templates/versions.yml.j2,
  for the services osism-ansible deploys.

Any versions['<key>'] reference counts as a read, including one that
only appears in a Jinja condition (osism, osism_ansible). Removing the
pin is one possible fix, so the plugin errs towards keeping pins.

The other runner images are not readers. container-image-kolla-ansible's
versions.yml.j2 takes its versions from the Kolla image SBOM, and
container-image-ceph-ansible reads only manager_version from base.yml.
A mirror that copies a pinned image, such as metalbox's registry
tarballs, is not a reader either: mirroring a tag does not deploy it.

A finding has three possible fixes: wire the pin into versions.yml.j2
if a role deploys the image, remove it if its consumer is gone, or
allowlist it if it waits for a planned role or is used outside the
transports. Four pins are allowlisted:

- pushgateway (osism/issues#1446) and openstack_database_exporter
  (osism/issues#1443), pinned ahead of roles still planned for Tally.
- syft, the SBOM tool the image builds run, and sonic_vs, the SONiC
  virtual switch that testbed's containerlab topology runs. Both are
  used outside the two transports.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Roger Luethi <luethi@osism.tech>
@ideaship
ideaship force-pushed the drift-release-pin-orphan branch from 652479a to b8bb579 Compare October 16, 2026 03:35
@ideaship
ideaship marked this pull request as ready for review October 16, 2026 03:35
@berendt
berendt merged commit de341fe into main Oct 16, 2026
2 checks passed
@berendt
berendt deleted the drift-release-pin-orphan branch October 16, 2026 07:41
@github-project-automation github-project-automation Bot moved this from New to Done in Human Board Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants