Preserve layer annotations from parent images during commit #6972
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 277 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.337
Real PR Conversation Timeline
1 comments
"Review active on #6972"
general
weight: 0.35
simonbrauner
What type of PR is this?
/kind bug
What this PR does / why we need it:
When building an image using FROM with a source that contains
layer annotations, the final committed image loses those
annotations.
Propagate the per-layer annotations to addLayer() for OCI
images to be present in the final committed image.
The annotations are only preserved if the layer
content doesn't change as their lookup relies
on the layer uncompressed digest not changing.
Introduce a new flag --inherit-layer-annotations for
the
buildah buildcommand to control inheritanceof per-layer annotations (default=true).
Extend the existing
buildah config --annotationflagto support "layer:" prefix for per-layer annotations
on the top-most (read-write) layer. The flag works
the same for per-layer annotation as it does for
image ones (set/unset key/clear all).
How to verify it
1. Pick an image with layer annotations, e.g.:
2. Build
fromit:3. Check annotations on the new image:
Which issue(s) this PR fixes:
Fixes https://github.com/podman-container-tools/buildah/issues/6652
Special notes for your reviewer:
I'm adding notes inline.
Does this PR introduce a user-facing change?
``
release-notebuildah buildWhen building an image using FROM with a source that contains layer annotations, commit now preserves the per-layer annotations.
The
command now accepts an optional flag--inherit-layer-annotations(default true) that controls inheritance for per-layer annotations.buildah config --annotationThe
flag now supports "layer:" prefix for per-layer annotations on the top-most layer and works the same for per-layer annotation as it does for image ones (set/unset key/clear all).
``