Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a bit more context to layer offset failures #264

Merged
merged 1 commit into from
Jul 31, 2018

Conversation

bobcatfish
Copy link
Contributor

In #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.

@@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How tough would it be to dump the full image digest as part of this? That way we could debug later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IT IS DONE

return 0, fmt.Errorf("Couldn't parse referance to image %s: %s", image, err)
return nil, fmt.Errorf("Couldn't parse referance to image %s: %s", image, err)
}
imgRef, err := daemon.Image(ref)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one of these should be a daemon.Image, right? The other is remote?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dlorenc the kaniko image is pulled right before this executes (maybe that should be made more clear somehow?)

@bobcatfish
Copy link
Contributor Author

Latest kokoro failure is a test timeout, very odd 🤔

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, and it will also include the
digest of the image, since kaniko always pushes images to a remote repo,
so if the test fails we can pull the digest and see what is up.

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.
@bobcatfish bobcatfish merged commit 5604820 into GoogleContainerTools:master Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants