Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pkg/image/controller/signature/container_image_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ func (s *containerImageSignatureDownloader) DownloadImageSignatures(image *image
if err != nil {
return nil, err
}
source, err := reference.NewImageSource(nil, nil)

ctx, cancel := context.WithTimeout(s.ctx, s.timeout)
defer cancel()

source, err := reference.NewImageSource(ctx, nil)
if err != nil {
// In case we fail to talk to registry to get the image metadata (private
// registry, internal registry, etc...), do not fail with error to avoid
Expand All @@ -46,9 +50,6 @@ func (s *containerImageSignatureDownloader) DownloadImageSignatures(image *image
}
defer source.Close()

ctx, cancel := context.WithTimeout(s.ctx, s.timeout)
defer cancel()

signatures, err := source.GetSignatures(ctx, nil)
if err != nil {
klog.V(4).Infof("Failed to get signatures for %v due to: %v", source.Reference(), err)
Expand Down