mirror of
https://github.com/clearlinux/rkt.git
synced 2026-11-25 21:42:50 +00:00
cas: satisfy acirenderer.ACIProvider interface.
This commit is contained in:
+2
-2
@@ -217,7 +217,7 @@ func (ds Store) WriteACI(r io.Reader) (string, error) {
|
||||
}
|
||||
|
||||
// Import the uncompressed image into the store at the real key
|
||||
key := HashToKey(h)
|
||||
key := ds.HashToKey(h)
|
||||
if err = ds.stores[blobType].Import(fh.Name(), key, true); err != nil {
|
||||
return "", fmt.Errorf("error importing image: %v", err)
|
||||
}
|
||||
@@ -304,7 +304,7 @@ func (ds Store) Dump(hex bool) {
|
||||
// HashToKey takes a hash.Hash (which currently _MUST_ represent a full SHA512),
|
||||
// calculates its sum, and returns a string which should be used as the key to
|
||||
// store the data matching the hash.
|
||||
func HashToKey(h hash.Hash) string {
|
||||
func (ds Store) HashToKey(h hash.Hash) string {
|
||||
s := h.Sum(nil)
|
||||
return keyToString(s)
|
||||
}
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ func expandImage(cfg PrepareConfig, img types.Hash, dest string) error {
|
||||
}
|
||||
|
||||
// TODO(jonboulle): clean this up, leaky abstraction with the store.
|
||||
if g := cas.HashToKey(hash); g != img.String() {
|
||||
if g := cfg.Store.HashToKey(hash); g != img.String() {
|
||||
return fmt.Errorf("image hash does not match expected (%v != %v)", g, img.String())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user