Skip to content

fix(control-plane): pin interceptor image by digest only for the spec repository - #1202

Merged
rh-amarin merged 1 commit into
mainfrom
fix/interceptor-image-repo-match
Nov 26, 2026
Merged

rh-amarin merged 1 commit into
mainfrom
fix/interceptor-image-repo-match

Conversation

@rh-amarin

Copy link
Copy Markdown
Collaborator

Summary

Gateways never become ready on Kind clusters that load the controller image from a podman archive. This PR fixes how the policy interceptor sidecar picks its image.

Reproduction (Lima VM, Kind with the podman provider)

  1. Create a Lima VM with the hypershell-lima skill. It runs Kind with the podman provider.
  2. The controller runs localhost/hypershell-controller:dev, loaded into Kind from an image archive.
  3. The kubelet reports the controller's ImageID as docker.io/library/import-2026-11-26@sha256:9ff3.... That is a placeholder name containerd gives to imported archives.
  4. imageFromPod returned any repo@sha256:... ImageID as the exact pin, so the interceptor sidecar used that name.
  5. The sidecar failed with ErrImagePull / ImagePullBackOff ("pull access denied, repository does not exist").
  6. Gateway pods never got ready, and e2e Phase P1 timed out after 360 s. This reproduces on main.

Fix

  • imageFromPod now uses the ImageID's repo@digest only when its repository matches the spec image's repository.
  • Both names are normalized with github.com/distribution/reference (ParseNormalizedNamed), so cp:dev matches docker.io/library/cp.
  • Any other ImageID (a bare digest, an import-... placeholder, a different repository) keeps the spec image.
  • Real registry images are still pinned by digest (PLAT-PGP-09.01).

Spec

Added a sentence to PLAT-PGP-09 and a new scenario, PLAT-PGP-09.03 (unpullable image ID falls back to the spec image). make check-spec-ids passes.

Tests

New table test TestOwnImagePinsDigestOnlyForTheSpecRepository (// Verifies: PLAT-PGP-09.01, PLAT-PGP-09.03):

  • matching registry repo gets the digest pin
  • docker-pullable:// prefix is stripped
  • familiar and normalized names match
  • import-... mismatch falls back to the spec image
  • a different repository falls back
  • bare digest and empty ImageID fall back

go build, go vet and go test ./... in components/control-plane pass, and make check passes at the repo root.

The OpenShell v0.1.10 bump (#1199) will be rebased onto this change.

🤖 Generated with Claude Code

… repository

The policy interceptor sidecar took any repo@sha256 image ID from the
controller's Pod status as its image. On Kind with the podman provider the
kubelet reports archive-loaded images as docker.io/library/import-<date>@sha256,
a name no registry serves, so the sidecar hit ImagePullBackOff and gateways
never became ready.

Use the image ID's digest pin only when its normalized repository matches the
spec image's repository; otherwise keep the spec image (PLAT-PGP-09.03).

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

HyperShell environment destroyed

This ephemeral OpenShift environment has been destroyed. Comment /pr-extend to redeploy it.

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@codecov-appsre

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...internal/reconciler/policy_interceptor_provider.go 66.66% 2 Missing and 2 partials ⚠️
@@            Coverage Diff             @@
##             main    #1202      +/-   ##
==========================================
- Coverage   46.94%   46.94%   -0.01%     
==========================================
  Files         474      474              
  Lines       38535    38546      +11     
==========================================
+ Hits        18091    18094       +3     
- Misses      18309    18315       +6     
- Partials     2135     2137       +2     
Flag Coverage Δ
control-plane 59.22% <66.66%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...internal/reconciler/policy_interceptor_provider.go 75.94% <66.66%> (-2.00%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e91d59...6ba5cc7. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rh-amarin
rh-amarin added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit cb70928 Nov 26, 2026
37 checks passed
@rh-amarin
rh-amarin deleted the fix/interceptor-image-repo-match branch November 26, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant