mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-07 01:31:43 +02:00
Use cachekey not digest for COPY --from src
* use the cachekey of the src stage rather than the digest for COPY --from commands as they are reproducible unlike digests * track digest to cache keys and stage indexes to digest * add extra debug logging for troubleshooting cachekey building issues * convert Sha256 hashes to hex encoded strings rather than plain strings for easier human reading
This commit is contained in:
@@ -18,6 +18,7 @@ package executor
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -75,7 +76,7 @@ func (s *CompositeCache) AddPath(p string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
s.keys = append(s.keys, string(sha.Sum(nil)))
|
||||
s.keys = append(s.keys, fmt.Sprintf("%x", sha.Sum(nil)))
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -98,5 +99,5 @@ func HashDir(p string) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(sha.Sum(nil)), nil
|
||||
return fmt.Sprintf("%x", sha.Sum(nil)), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user