Add index annotation support#306
Open
TIR44 wants to merge 1 commit into
Open
Conversation
1 task
TIR44
force-pushed
the
feature/index-annotations
branch
from
May 31, 2026 11:08
d466233 to
516e22c
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #306 +/- ##
==========================================
+ Coverage 34.66% 36.36% +1.70%
==========================================
Files 39 39
Lines 3359 3378 +19
==========================================
+ Hits 1164 1228 +64
+ Misses 2000 1943 -57
- Partials 195 207 +12 🚀 New features to boost your workflow:
|
TIR44
marked this pull request as ready for review
May 31, 2026 11:13
TIR44
force-pushed
the
feature/index-annotations
branch
from
May 31, 2026 11:17
516e22c to
9a31ed1
Compare
Signed-off-by: TiR <70480807+TIR44@users.noreply.github.com>
TIR44
force-pushed
the
feature/index-annotations
branch
from
May 31, 2026 11:38
9a31ed1 to
6ad67aa
Compare
jabrown85
reviewed
Jun 1, 2026
| return err | ||
| } | ||
|
|
||
| index, err := imageIndex.IndexManifest() |
Contributor
There was a problem hiding this comment.
Is there a reason we are re-reading IndexManifest when the only caller is SaveDir which already has pulled it?
| }) | ||
| } | ||
|
|
||
| func (h *CNBIndex) SetIndexAnnotations(annotations map[string]string) (err error) { |
Contributor
There was a problem hiding this comment.
This is more of a merge than a set. Maybe change the name to match the tests?
| }) | ||
| } | ||
|
|
||
| func (h *CNBIndex) SetIndexAnnotations(annotations map[string]string) (err error) { |
Contributor
There was a problem hiding this comment.
nit: new methods should have doc comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ImageIndex.SetIndexAnnotationsfor top-level index annotationsSaveDir()rewrites the localindex.jsonImageIndexContext
This is the imgutil prerequisite for buildpacks/pack#2586. The pack-side
manifest annotate --indexflow needs an imgutil API that can write annotations to the index manifest itself, not only to a manifest descriptor inside the index.Tests
go test . -run TestCNBIndexSetIndexAnnotations -count=1go test . -run 'TestCNBIndex(SetIndexAnnotations|SaveDirWithoutIndexAnnotations)' -count=1go test . -count=1go test ./... -run '^$' -count=1make formatGitHub checks passed on the latest commit (
6ad67aa): DCO, Linux, Linux containerd, Windows, Codecov patch, and Codecov project.Local Docker-dependent tests could not be run because this machine has no Docker socket at
/var/run/docker.sock:go test ./layout -run TestLayoutIndex -count=1go test ./fakes -count=1