diff --git a/core/metadata/buckets.go b/core/metadata/buckets.go index 9ccfaee83..c07543958 100644 --- a/core/metadata/buckets.go +++ b/core/metadata/buckets.go @@ -28,113 +28,114 @@ // // /// -> // -// version: Currently, this is "v1". Additions can be made to v1 in a backwards -// compatible way. If the layout changes, a new version must be made, along -// with a migration. +// version +// Currently, this is "v1". Additions can be made to v1 in a backwards +// compatible way. If the layout changes, a new version must be made, +// along with a migration. // -// namespace: the namespace to which this object belongs. +// namespace +// The namespace to which this object belongs. // -// object: defines which object set is stored in the bucket. There are two -// special objects, "labels" and "indexes". The "labels" bucket stores the -// labels for the parent namespace. The "indexes" object is reserved for -// indexing objects, if we require in the future. +// object +// Defines which object set is stored in the bucket. There are two +// special objects, "labels" and "indexes". The "labels" bucket +// stores the labels for the parent namespace. The "indexes" object +// is reserved for indexing objects, if we require in the future. // -// key: object-specific key identifying the storage bucket for the objects -// contents. +// key +// Object-specific key identifying the storage bucket for the +// object's contents. // // Below is the current database schema. This should be updated each time // the structure is changed in addition to adding a migration and incrementing // the database version. -// Notes: // -// - `╘══*...*` refers to maps with arbitrary keys +// Notes +// • `╘══*...*` refers to maps with arbitrary keys +// • `version` is a key to a numeric value identifying the minor revisions +// of schema version +// • a namespace in a schema bucket cannot be named "version" // -// - `version` is a key to a numeric value identifying the minor revisions -// of schema version -// -// - a namespace in a schema bucket cannot be named "version" -// -/* - └──v1 - Schema version bucket - ├──version : - Latest version, see migrations - ╘══*namespace* - ├──labels - │ ╘══*key* : - Label value - ├──image - │ ╘══*image name* - │ ├──createdat : - Created at - │ ├──updatedat : - Updated at - │ ├──target - │ │ ├──digest : - Descriptor digest - │ │ ├──mediatype : - Descriptor media type - │ │ └──size : - Descriptor size - │ └──labels - │ ╘══*key* : - Label value - ├──containers - │ ╘══*container id* - │ ├──createdat : - Created at - │ ├──updatedat : - Updated at - │ ├──spec : - Proto marshaled spec - │ ├──image : - Image name - │ ├──snapshotter : - Snapshotter name - │ ├──snapshotKey : - Snapshot key - │ ├──runtime - │ │ ├──name : - Runtime name - │ │ └──options : - Proto marshaled options - │ ├──extensions - │ │ ╘══*name* : - Proto marshaled extension - │ └──labels - │ ╘══*key* : - Label value - ├──snapshots - │ ╘══*snapshotter* - │ ╘══*snapshot key* - │ ├──name : - Snapshot name in backend - │ ├──createdat : - Created at - │ ├──updatedat : - Updated at - │ ├──parent : - Parent snapshot name - │ ├──children - │ │ ╘══*snapshot key* : - Child snapshot reference - │ └──labels - │ ╘══*key* : - Label value - ├──content - │ ├──blob - │ │ ╘══*blob digest* - │ │ ├──createdat : - Created at - │ │ ├──updatedat : - Updated at - │ │ ├──size : - Blob size - │ │ └──labels - │ │ ╘══*key* : - Label value - │ └──ingests - │ ╘══*ingest reference* - │ ├──ref : - Ingest reference in backend - │ ├──expireat : - Time to expire ingest - │ └──expected : - Expected commit digest - ├──sandboxes - │ ╘══*sandbox id* - │ ├──createdat : - Created at - │ ├──updatedat : - Updated at - │ ├──spec : - Proto marshaled spec - │ ├──sandboxer : - Sandboxer name - │ ├──runtime - │ │ ├──name : - Runtime name - │ │ └──options : - Proto marshaled options - │ ├──extensions - │ │ ╘══*name* : - Proto marshaled extension - │ └──labels - │ ╘══*key* : - Label value - └──leases - ╘══*lease id* - ├──createdat : - Created at - ├──labels - │ ╘══*key* : - Label value - ├──snapshots - │ ╘══*snapshotter* - │ ╘══*snapshot key* : - Snapshot reference - ├──content - │ ╘══*blob digest* : - Content blob reference - └─────ingests - ╘══*ingest reference* : - Content ingest reference -*/ +// Schema +// └──v1 - Schema version bucket +// ├──version : - Latest version, see migrations +// ╘══*namespace* +// ├──labels +// │ ╘══*key* : - Label value +// ├──image +// │ ╘══*image name* +// │ ├──createdat : - Created at +// │ ├──updatedat : - Updated at +// │ ├──target +// │ │ ├──digest : - Descriptor digest +// │ │ ├──mediatype : - Descriptor media type +// │ │ └──size : - Descriptor size +// │ └──labels +// │ ╘══*key* : - Label value +// ├──containers +// │ ╘══*container id* +// │ ├──createdat : - Created at +// │ ├──updatedat : - Updated at +// │ ├──spec : - Proto marshaled spec +// │ ├──image : - Image name +// │ ├──snapshotter : - Snapshotter name +// │ ├──snapshotKey : - Snapshot key +// │ ├──runtime +// │ │ ├──name : - Runtime name +// │ │ └──options : - Proto marshaled options +// │ ├──extensions +// │ │ ╘══*name* : - Proto marshaled extension +// │ └──labels +// │ ╘══*key* : - Label value +// ├──snapshots +// │ ╘══*snapshotter* +// │ ╘══*snapshot key* +// │ ├──name : - Snapshot name in backend +// │ ├──createdat : - Created at +// │ ├──updatedat : - Updated at +// │ ├──parent : - Parent snapshot name +// │ ├──children +// │ │ ╘══*snapshot key* : - Child snapshot reference +// │ └──labels +// │ ╘══*key* : - Label value +// ├──content +// │ ├──blob +// │ │ ╘══*blob digest* +// │ │ ├──createdat : - Created at +// │ │ ├──updatedat : - Updated at +// │ │ ├──size : - Blob size +// │ │ └──labels +// │ │ ╘══*key* : - Label value +// │ └──ingests +// │ ╘══*ingest reference* +// │ ├──ref : - Ingest reference in backend +// │ ├──expireat : - Time to expire ingest +// │ └──expected : - Expected commit digest +// ├──sandboxes +// │ ╘══*sandbox id* +// │ ├──createdat : - Created at +// │ ├──updatedat : - Updated at +// │ ├──spec : - Proto marshaled spec +// │ ├──sandboxer : - Sandboxer name +// │ ├──runtime +// │ │ ├──name : - Runtime name +// │ │ └──options : - Proto marshaled options +// │ ├──extensions +// │ │ ╘══*name* : - Proto marshaled extension +// │ └──labels +// │ ╘══*key* : - Label value +// └──leases +// ╘══*lease id* +// ├──createdat : - Created at +// ├──labels +// │ ╘══*key* : - Label value +// ├──snapshots +// │ ╘══*snapshotter* +// │ ╘══*snapshot key* : - Snapshot reference +// ├──content +// │ ╘══*blob digest* : - Content blob reference +// └─────ingests +// ╘══*ingest reference* : - Content ingest reference package metadata import (