Skip to content

Commit 311fe2b

Browse files
committed
test: Suppress the logs when Unpack function
Suppress logs from Unpack function which is causing errors to be written to the benchmark results. Signed-off-by: Edmund Ochieng <[email protected]>
1 parent a9fade1 commit 311fe2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: internal/rukpak/source/image_registry.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ func (i *ImageRegistry) Unpack(ctx context.Context, bundle *BundleSource) (*Resu
8484
}
8585
authChain, err := k8schain.NewInCluster(ctx, chainOpts)
8686
if err != nil {
87+
l.Error(err, "we encountered an issue getting auth keychain")
8788
return nil, fmt.Errorf("error getting auth keychain: %w", err)
8889
}
8990

@@ -114,17 +115,16 @@ func (i *ImageRegistry) Unpack(ctx context.Context, bundle *BundleSource) (*Resu
114115
hexVal := strings.TrimPrefix(digest.DigestStr(), "sha256:")
115116
unpackPath := filepath.Join(i.BaseCachePath, bundle.Name, hexVal)
116117
if stat, err := os.Stat(unpackPath); err == nil && stat.IsDir() {
117-
l.V(1).Info("found image in filesystem cache", "digest", hexVal)
118118
return unpackedResult(os.DirFS(unpackPath), bundle, digest.String()), nil
119119
}
120120
}
121121

122122
// always fetch the hash
123123
imgDesc, err := remote.Head(imgRef, remoteOpts...)
124124
if err != nil {
125+
l.Error(err, "failed fetching image descriptor")
125126
return nil, fmt.Errorf("error fetching image descriptor: %w", err)
126127
}
127-
l.V(1).Info("resolved image descriptor", "digest", imgDesc.Digest.String())
128128

129129
unpackPath := filepath.Join(i.BaseCachePath, bundle.Name, imgDesc.Digest.Hex)
130130
if _, err = os.Stat(unpackPath); errors.Is(err, os.ErrNotExist) { //nolint: nestif

0 commit comments

Comments
 (0)