cas: satisfy acirenderer.ACIProvider interface.

This commit is contained in:
Simone Gotti
2015-03-10 10:54:55 +01:00
parent 6d0dccb1d7
commit 3642118762
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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
View File
@@ -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())
}