Rename prepare to unpack and init to prepare

Unpack and prepare better map to the actions done by rootfs.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan 2017-03-14 23:34:32 -07:00
parent 340e56ecd0
commit b1bc82726f
No known key found for this signature in database
GPG key ID: F58C5D0A4405ACDB
8 changed files with 164 additions and 158 deletions

View file

@ -36,10 +36,15 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// Descriptor describes a blob in a content store.
//
// This descriptor can be used to reference content from an
// oci descriptor found in a manifest.
// See https://godoc.org/github.com/opencontainers/image-spec/specs-go/v1#Descriptor
type Descriptor struct {
MediaType string `protobuf:"bytes,1,opt,name=mediaType,proto3" json:"mediaType,omitempty"`
Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,2,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
MediaSize int64 `protobuf:"varint,3,opt,name=mediaSize,proto3" json:"mediaSize,omitempty"`
Size_ int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
}
func (m *Descriptor) Reset() { *m = Descriptor{} }
@ -76,10 +81,10 @@ func (m *Descriptor) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintDescriptor(dAtA, i, uint64(len(m.Digest)))
i += copy(dAtA[i:], m.Digest)
}
if m.MediaSize != 0 {
if m.Size_ != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintDescriptor(dAtA, i, uint64(m.MediaSize))
i = encodeVarintDescriptor(dAtA, i, uint64(m.Size_))
}
return i, nil
}
@ -122,8 +127,8 @@ func (m *Descriptor) Size() (n int) {
if l > 0 {
n += 1 + l + sovDescriptor(uint64(l))
}
if m.MediaSize != 0 {
n += 1 + sovDescriptor(uint64(m.MediaSize))
if m.Size_ != 0 {
n += 1 + sovDescriptor(uint64(m.Size_))
}
return n
}
@ -148,7 +153,7 @@ func (this *Descriptor) String() string {
s := strings.Join([]string{`&Descriptor{`,
`MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`,
`Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
`MediaSize:` + fmt.Sprintf("%v", this.MediaSize) + `,`,
`Size_:` + fmt.Sprintf("%v", this.Size_) + `,`,
`}`,
}, "")
return s
@ -250,9 +255,9 @@ func (m *Descriptor) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field MediaSize", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
}
m.MediaSize = 0
m.Size_ = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowDescriptor
@ -262,7 +267,7 @@ func (m *Descriptor) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.MediaSize |= (int64(b) & 0x7F) << shift
m.Size_ |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
@ -398,20 +403,20 @@ func init() {
}
var fileDescriptorDescriptor = []byte{
// 230 bytes of a gzipped FileDescriptorProto
// 231 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4a, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xc9, 0x4f, 0xce, 0x4e, 0x2d, 0xd2, 0x4f, 0xce,
0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d, 0x4a, 0xd1, 0x4f, 0x2c, 0xc8, 0xd4, 0x2f, 0xa9, 0x2c,
0x48, 0x2d, 0xd6, 0x4f, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0x2f, 0x42, 0x62, 0xea,
0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x23, 0x74, 0xe8, 0x95, 0x19, 0xea, 0x81, 0x35, 0x48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0x05, 0x46, 0x0d, 0xce, 0x20, 0x84, 0x80, 0x90, 0x17, 0x17, 0x5b, 0x4a, 0x66,
0x7a, 0x6a, 0x71, 0x89, 0x04, 0x13, 0x48, 0xca, 0xc9, 0xe8, 0xc4, 0x3d, 0x79, 0x86, 0x5b, 0xf7,
0xe4, 0xb5, 0x90, 0xdc, 0x9c, 0x5f, 0x90, 0x9a, 0x07, 0xb7, 0xbe, 0x58, 0x3f, 0x3d, 0x5f, 0x17,
0xa2, 0x45, 0xcf, 0x05, 0x4c, 0x05, 0x41, 0x4d, 0x10, 0x12, 0xe2, 0x62, 0x29, 0xce, 0xac, 0x4a,
0x95, 0x60, 0x56, 0x60, 0xd4, 0x60, 0x0e, 0x02, 0xb3, 0x9d, 0x24, 0x4e, 0x3c, 0x94, 0x63, 0xb8,
0xf1, 0x50, 0x8e, 0xa1, 0xe1, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31,
0x3e, 0x78, 0x24, 0xc7, 0x98, 0xc4, 0x06, 0x76, 0xad, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x37,
0xe8, 0x43, 0x79, 0x1e, 0x01, 0x00, 0x00,
}

View file

@ -12,5 +12,5 @@ import "gogoproto/gogo.proto";
message Descriptor {
string mediaType = 1;
string digest = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
int64 mediaSize = 3;
int64 size = 3;
}