@@ -25,17 +25,20 @@ import (
2525 "strings"
2626 "time"
2727
28+ orasRegistry "oras.land/oras-go/v2/registry"
29+ "oras.land/oras-go/v2/registry/remote"
30+
2831 "github.com/notaryproject/notation-core-go/signature"
2932 "github.com/notaryproject/notation-go/internal/envelope"
3033 "github.com/notaryproject/notation-go/log"
3134 "github.com/notaryproject/notation-go/registry"
3235 "github.com/notaryproject/notation-go/verifier/trustpolicy"
3336 "github.com/opencontainers/go-digest"
3437 ocispec "github.com/opencontainers/image-spec/specs-go/v1"
35- orasRegistry "oras.land/oras-go/v2/registry"
3638)
3739
3840var errDoneVerification = errors .New ("done verification" )
41+
3942var reservedAnnotationPrefixes = [... ]string {"io.cncf.notary" }
4043
4144// SignerSignOptions contains parameters for Signer.Sign.
@@ -145,7 +148,11 @@ func Sign(ctx context.Context, signer Signer, repo registry.Repository, signOpts
145148 logger .Debugf ("Pushing signature of artifact descriptor: %+v, signature media type: %v" , targetDesc , signOpts .SignatureMediaType )
146149 _ , _ , err = repo .PushSignature (ctx , signOpts .SignatureMediaType , sig , targetDesc , annotations )
147150 if err != nil {
148- logger .Error ("Failed to push the signature" )
151+ var referrerError * remote.ReferrersError
152+ // do not log an error for failing to delete referral index
153+ if ! errors .As (err , & referrerError ) || ! referrerError .IsReferrersIndexDelete () {
154+ logger .Error ("Failed to push the signature" )
155+ }
149156 return ocispec.Descriptor {}, ErrorPushSignatureFailed {Msg : err .Error ()}
150157 }
151158
0 commit comments