Skip to content

Fix registry inventory key mismatch causing all images to be _LOST_#1731

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
saschagrunert:fix/registry-inventory-key-mismatch
Feb 26, 2026
Merged

Fix registry inventory key mismatch causing all images to be _LOST_#1731
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
saschagrunert:fix/registry-inventory-key-mismatch

Conversation

@saschagrunert
Copy link
Copy Markdown
Member

What type of PR is this?

/kind bug
/kind regression

What this PR does / why we need it:

Fixes a regression introduced in v4.3.0 where GetPromotionEdges passed full-path registries (with image names appended, e.g. gcr.io/staging/driver) from GetRegistriesToRead to ReadRegistries. makeTagRecorder used these for splitByKnownRegistries, which produced an exact match with an empty image name, keying the inventory as inv["gcr.io/staging/driver"][""].

However, vertexPropsFor looks up by the original edge registry name inv["gcr.io/staging"]["driver"], which never matched, causing every source digest to be marked _LOST_ and no images to be promoted.

The fix adds GetBaseRegistries to collect the original registry contexts (without image name suffixes) from edges, and passes them to ReadRegistries as separate baseRegistries for correct inventory keying.

Special notes for your reviewer:

This broke all image promotion in production with v4.3.0. The post-k8sio-image-promo Prow job succeeds but promotes zero images.

Does this PR introduce a user-facing change?

Fix regression where image promotion marked all source images as _LOST_ due to registry inventory key mismatch.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. labels Feb 26, 2026
@k8s-ci-robot k8s-ci-robot requested a review from cici37 February 26, 2026 08:30
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 26, 2026
@k8s-ci-robot k8s-ci-robot requested a review from cpanato February 26, 2026 08:30
@k8s-ci-robot k8s-ci-robot added area/artifacts Issues or PRs related to the hosting of release artifacts for subprojects approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 26, 2026
@saschagrunert saschagrunert changed the title Fix registry inventory key mismatch causing all images to be _LOST_ WIP: Fix registry inventory key mismatch causing all images to be _LOST_ Feb 26, 2026
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 26, 2026
@saschagrunert saschagrunert force-pushed the fix/registry-inventory-key-mismatch branch from f2ebaad to f3d8404 Compare February 26, 2026 08:39
ReadRegistries uses full-path registries from GetRegistriesToRead
(e.g. gcr.io/k8s-staging-foo/driver) for splitByKnownRegistries,
which exact-matches and returns an empty image name. This causes
a key mismatch: the inventory is keyed as inv[fullPath][""] but
vertexPropsFor looks up inv[basePath]["driver"].

Add a baseRegistries parameter to ReadRegistries so that
splitByKnownRegistries uses the original base registry paths
for correct splitting, while still reading only the specific
repositories needed.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@saschagrunert saschagrunert force-pushed the fix/registry-inventory-key-mismatch branch from f3d8404 to 416e45d Compare February 26, 2026 08:40
@saschagrunert saschagrunert changed the title WIP: Fix registry inventory key mismatch causing all images to be _LOST_ Fix registry inventory key mismatch causing all images to be _LOST_ Feb 26, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 26, 2026
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 26, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [cpanato,saschagrunert]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 8478cdc into kubernetes-sigs:main Feb 26, 2026
5 checks passed
@saschagrunert saschagrunert deleted the fix/registry-inventory-key-mismatch branch February 26, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/artifacts Issues or PRs related to the hosting of release artifacts for subprojects area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants