Move manifest package to schema1
As we begin our march towards multi-arch, we must prepare for the reality of multiple manifest schemas. This is the beginning of a set of changes to facilitate this. We are both moving this package into its target position where it may live peacefully next to other manfiest versions. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
1
manifest/doc.go
Normal file
1
manifest/doc.go
Normal file
@@ -0,0 +1 @@
|
||||
package manifest
|
@@ -1,9 +1,10 @@
|
||||
package manifest
|
||||
package schema1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/docker/distribution/digest"
|
||||
"github.com/docker/distribution/manifest"
|
||||
"github.com/docker/libtrust"
|
||||
)
|
||||
|
||||
@@ -17,18 +18,18 @@ const (
|
||||
ManifestMediaType = "application/vnd.docker.distribution.manifest.v1+json"
|
||||
)
|
||||
|
||||
// Versioned provides a struct with just the manifest schemaVersion. Incoming
|
||||
// content with unknown schema version can be decoded against this struct to
|
||||
// check the version.
|
||||
type Versioned struct {
|
||||
// SchemaVersion is the image manifest schema that this image follows
|
||||
SchemaVersion int `json:"schemaVersion"`
|
||||
}
|
||||
var (
|
||||
// SchemaVersion provides a pre-initialized version structure for this
|
||||
// packages version of the manifest.
|
||||
SchemaVersion = manifest.Versioned{
|
||||
SchemaVersion: 1,
|
||||
}
|
||||
)
|
||||
|
||||
// Manifest provides the base accessible fields for working with V2 image
|
||||
// format in the registry.
|
||||
type Manifest struct {
|
||||
Versioned
|
||||
manifest.Versioned
|
||||
|
||||
// Name is the name of the image's repository
|
||||
Name string `json:"name"`
|
@@ -1,4 +1,4 @@
|
||||
package manifest
|
||||
package schema1
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -80,11 +80,9 @@ func genEnv(t *testing.T) *testEnv {
|
||||
name, tag := "foo/bar", "test"
|
||||
|
||||
m := Manifest{
|
||||
Versioned: Versioned{
|
||||
SchemaVersion: 1,
|
||||
},
|
||||
Name: name,
|
||||
Tag: tag,
|
||||
Versioned: SchemaVersion,
|
||||
Name: name,
|
||||
Tag: tag,
|
||||
FSLayers: []FSLayer{
|
||||
{
|
||||
BlobSum: "asdf",
|
@@ -1,4 +1,4 @@
|
||||
package manifest
|
||||
package schema1
|
||||
|
||||
import (
|
||||
"crypto/x509"
|
@@ -1,4 +1,4 @@
|
||||
package manifest
|
||||
package schema1
|
||||
|
||||
import (
|
||||
"crypto/x509"
|
9
manifest/versioned.go
Normal file
9
manifest/versioned.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package manifest
|
||||
|
||||
// Versioned provides a struct with just the manifest schemaVersion. Incoming
|
||||
// content with unknown schema version can be decoded against this struct to
|
||||
// check the version.
|
||||
type Versioned struct {
|
||||
// SchemaVersion is the image manifest schema that this image follows
|
||||
SchemaVersion int `json:"schemaVersion"`
|
||||
}
|
Reference in New Issue
Block a user