| ... | ... |
@@ -85,9 +85,10 @@ func (graph *Graph) Get(name string) (*Image, error) {
|
| 85 | 85 |
// Create creates a new image and registers it in the graph. |
| 86 | 86 |
func (graph *Graph) Create(layerData Archive, container *Container, comment string) (*Image, error) {
|
| 87 | 87 |
img := &Image{
|
| 88 |
- Id: GenerateId(), |
|
| 89 |
- Comment: comment, |
|
| 90 |
- Created: time.Now(), |
|
| 88 |
+ Id: GenerateId(), |
|
| 89 |
+ Comment: comment, |
|
| 90 |
+ Created: time.Now(), |
|
| 91 |
+ DockerVersion: VERSION, |
|
| 91 | 92 |
} |
| 92 | 93 |
if container != nil {
|
| 93 | 94 |
img.Parent = container.Image |
| ... | ... |
@@ -45,6 +45,9 @@ func TestGraphCreate(t *testing.T) {
|
| 45 | 45 |
if image.Comment != "Testing" {
|
| 46 | 46 |
t.Fatalf("Wrong comment: should be '%s', not '%s'", "Testing", image.Comment)
|
| 47 | 47 |
} |
| 48 |
+ if image.DockerVersion != VERSION {
|
|
| 49 |
+ t.Fatalf("Wrong docker_version: should be '%s', not '%s'", VERSION, image.DockerVersion)
|
|
| 50 |
+ } |
|
| 48 | 51 |
if images, err := graph.All(); err != nil {
|
| 49 | 52 |
t.Fatal(err) |
| 50 | 53 |
} else if l := len(images); l != 1 {
|