Conversation
Signed-off-by: Song Duan <dsong.cc@gmail.com> Signed-off-by: clcc2019 <46099295+clcc2019@users.noreply.github.com>
c4b2723 to
1e97f18
Compare
joaopapereira
left a comment
There was a problem hiding this comment.
Need some linter clearing and also test are failing, do you mind fixing that?
Text describe still never prints metadata (bundleTextPrinter); only YAML does. Issue #632 used -o yaml, so OK for the fix, but I would prefer to have consistent UX output.
We are missing a test for “no bundle.yml → empty metadata” (claimed in description).
I was contemplating another question about this PR and that is that we have to read the image 2 times to get the bundle.yaml file and the images.yaml, when we already have the image downloaded locally in the SingleLayerReader. What I am debating here is if this is going to make the Read slower and that will affect the overall performance of imgpkg so that when we do describe it is faster. But as I was writing this I think I convinced myself that it is better to have a slower describe than a slower pull or copy. nevertheless I think it makes sense to maybe have SingleLayerReader to be able to have another function called ReadBundleInfo or something of the sorts and have a function called func (o *SingleLayerReader) read(img regv1.Image, filename string) ([]byte, error) that basically we can extract the logic of reading a file from a layer and after that Read would call o.read(img, ImagesLockFile) while the ReadBundleInfo would call the o.read(img, BundleMetadataFile)
Summary
.imgpkg/bundle.ymldirectly from each bundle imageimgpkg describeoutputbundle.ymlis absentFixes #632
Testing
go test ./pkg/imgpkg/v1 -run '^TestDescribeBundleMetadata$' -count=1\n-go test ./pkg/imgpkg/v1 -run '^TestDescribeBundle$' -count=1\n-git diff --check