Add versioning to docker image format. IMPORTANT: the format versioning is pegged to docker's versioning, so changes to the format MUST trigger an increment in version number.
This commit is contained in:
parent
3de51b7bfe
commit
8bfbdd7afa
1
graph.go
1
graph.go
|
@ -88,6 +88,7 @@ func (graph *Graph) Create(layerData Archive, container *Container, comment stri
|
|||
Id: GenerateId(),
|
||||
Comment: comment,
|
||||
Created: time.Now(),
|
||||
DockerVersion: VERSION,
|
||||
}
|
||||
if container != nil {
|
||||
img.Parent = container.Image
|
||||
|
|
|
@ -45,6 +45,9 @@ func TestGraphCreate(t *testing.T) {
|
|||
if image.Comment != "Testing" {
|
||||
t.Fatalf("Wrong comment: should be '%s', not '%s'", "Testing", image.Comment)
|
||||
}
|
||||
if image.DockerVersion != VERSION {
|
||||
t.Fatalf("Wrong docker_version: should be '%s', not '%s'", VERSION, image.DockerVersion)
|
||||
}
|
||||
if images, err := graph.All(); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if l := len(images); l != 1 {
|
||||
|
|
Loading…
Reference in New Issue