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

fix: resolve integration test issue issue where container-diff cannot pull OCI images properly from registry #2918

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,21 @@ func meetsRequirements() bool {

// containerDiff compares the container images image1 and image2.
func containerDiff(t *testing.T, image1, image2 string, flags ...string) []byte {
// workaround for container-diff OCI issue https://github.com/GoogleContainerTools/container-diff/issues/389
if !strings.HasPrefix(image1, daemonPrefix) {
dockerPullCmd := exec.Command("docker", "pull", image1)
out := RunCommand(dockerPullCmd, t)
t.Logf("docker pull cmd output for image1 = %s", string(out))
image1 = daemonPrefix + image1
}

if !strings.HasPrefix(image2, daemonPrefix) {
dockerPullCmd := exec.Command("docker", "pull", image2)
out := RunCommand(dockerPullCmd, t)
t.Logf("docker pull cmd output for image2 = %s", string(out))
image2 = daemonPrefix + image2
}

flags = append([]string{"diff"}, flags...)
flags = append(flags, image1, image2,
"-q", "--type=file", "--type=metadata", "--json")
Expand Down
Loading