From 836c49722ca850800d3ef5134543948b1fce193f Mon Sep 17 00:00:00 2001 From: Xiaoxuan Wang <103478229+wangxiaoxuan273@users.noreply.github.com> Date: Thu, 26 Dec 2024 20:15:02 +0800 Subject: [PATCH] fix: add digest to fetched status output of `manifest index create` (#1579) Signed-off-by: Xiaoxuan Wang Co-authored-by: Xiaoxuan Wang Co-authored-by: Terry Howe --- cmd/oras/internal/display/status/text.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/oras/internal/display/status/text.go b/cmd/oras/internal/display/status/text.go index ee6852abb..70e3473e1 100644 --- a/cmd/oras/internal/display/status/text.go +++ b/cmd/oras/internal/display/status/text.go @@ -238,8 +238,11 @@ func (mich *TextManifestIndexCreateHandler) OnFetching(source string) error { } // OnFetched implements ManifestIndexCreateHandler. -func (mich *TextManifestIndexCreateHandler) OnFetched(source string, _ ocispec.Descriptor) error { - return mich.printer.Println(IndexPromptFetched, source) +func (mich *TextManifestIndexCreateHandler) OnFetched(ref string, desc ocispec.Descriptor) error { + if contentutil.IsDigest(ref) { + return mich.printer.Println(IndexPromptFetched, ref) + } + return mich.printer.Println(IndexPromptFetched, desc.Digest, ref) } // OnIndexPacked implements ManifestIndexCreateHandler.