From 36421187625fc2f5b0724e4e6c358a574bbbaf3f Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Tue, 10 Mar 2015 10:54:55 +0100 Subject: [PATCH] cas: satisfy acirenderer.ACIProvider interface. --- cas/cas.go | 4 ++-- stage0/run.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cas/cas.go b/cas/cas.go index 4383d97..5f72660 100644 --- a/cas/cas.go +++ b/cas/cas.go @@ -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) } diff --git a/stage0/run.go b/stage0/run.go index 6eb4040..3972895 100644 --- a/stage0/run.go +++ b/stage0/run.go @@ -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()) }