Skip to content

Commit

Permalink
Add a bit more context to layer offset failures
Browse files Browse the repository at this point in the history
In GoogleContainerTools#251 we are investigating test flakes due to layer offsets not
matching, this change will give us a bit more context so we can be sure
which image has which number of layers.

Also updated reproducible Dockerfile to be built with reproducible flag,
which I think was the original intent (without this change, there is no
difference between how `kaniko-dockerfile_test_copy_reproducible` and
`kaniko-dockerfile_test_copy` are built.
  • Loading branch information
bobcatfish committed Jul 31, 2018
1 parent 0d7eba9 commit 2f4ac08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion integration/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var additionalKanikoFlagsMap = map[string][]string{
}

var bucketContextTests = []string{"Dockerfile_test_copy_bucket"}
var reproducibleTests = []string{"Dockerfile_test_env"}
var reproducibleTests = []string{"Dockerfile_test_reproducible"}

// GetDockerImage constructs the name of the docker image that would be built with
// dockerfile if it was tagged with imageRepo.
Expand Down
2 changes: 1 addition & 1 deletion integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func checkLayers(image1, image2 string, offset int) error {
}
actualOffset := int(math.Abs(float64(lenImage1 - lenImage2)))
if actualOffset != offset {
return fmt.Errorf("incorrect offset between layers of %s and %s: expected %d but got %d", image1, image2, offset, actualOffset)
return fmt.Errorf("Difference in number of layers in each image is %d but should be %d. %s has %d layers and %s has %d layers", actualOffset, offset, image1, lenImage1, image2, lenImage2)
}
return nil
}
Expand Down

0 comments on commit 2f4ac08

Please sign in to comment.