Update GRPC for consistency

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-20 17:47:59 -07:00
parent 13e7d3c393
commit 94eafaab60
56 changed files with 3941 additions and 2802 deletions

View File

@@ -146,7 +146,9 @@ func readContainer(container *containers.Container, bkt *bolt.Bucket) error {
case string(bucketKeyImage):
container.Image = string(v)
case string(bucketKeyRuntime):
container.Runtime = string(v)
if err := container.Runtime.UnmarshalBinary(v); err != nil {
return err
}
case string(bucketKeySpec):
container.Spec = make([]byte, len(v))
copy(container.Spec, v)
@@ -187,9 +189,13 @@ func writeContainer(container *containers.Container, bkt *bolt.Bucket) error {
if err != nil {
return err
}
runtime, err := container.Runtime.MarshalBinary()
if err != nil {
return err
}
for _, v := range [][2][]byte{
{bucketKeyImage, []byte(container.Image)},
{bucketKeyRuntime, []byte(container.Runtime)},
{bucketKeyRuntime, runtime},
{bucketKeySpec, container.Spec},
{bucketKeyRootFS, []byte(container.RootFS)},
{bucketKeyCreatedAt, createdAt},

View File

@@ -46,7 +46,7 @@ func (s *imageStore) Get(ctx context.Context, name string) (images.Image, error)
return image, nil
}
func (s *imageStore) Put(ctx context.Context, name string, desc ocispec.Descriptor) error {
func (s *imageStore) Update(ctx context.Context, name string, desc ocispec.Descriptor) error {
namespace, err := namespaces.NamespaceRequired(ctx)
if err != nil {
return err