mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-21 12:33:00 +02:00
Update error handling and logging for cache
Previously we returned a low level file system error when checking for a cached image. By adding a more human friendly log message and explicit error handling we improve upon the user experience.
This commit is contained in:
Vendored
+3
-2
@@ -28,7 +28,7 @@ import (
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/config"
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/creds"
|
||||
"github.com/google/go-containerregistry/pkg/name"
|
||||
"github.com/google/go-containerregistry/pkg/v1"
|
||||
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||
"github.com/google/go-containerregistry/pkg/v1/remote"
|
||||
"github.com/google/go-containerregistry/pkg/v1/tarball"
|
||||
"github.com/pkg/errors"
|
||||
@@ -124,7 +124,8 @@ func LocalSource(opts *config.CacheOptions, cacheKey string) (v1.Image, error) {
|
||||
|
||||
fi, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "getting file info")
|
||||
logrus.Debugf("No file found for cache key %v %v", cacheKey, err)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// A stale cache is a bad cache
|
||||
|
||||
Reference in New Issue
Block a user