Skip to content

Commit

Permalink
Pin containers that are used for digest tests. (bazelbuild#980)
Browse files Browse the repository at this point in the history
  • Loading branch information
xingao267 authored and k8s-ci-robot committed Jul 12, 2019
1 parent 63fd7c1 commit b041d41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
11 changes: 7 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ load(
"new_container_pull",
)

# These are for testing the new container pull
# These are for testing the new container pull.
# For testing, don't change the sha.
new_container_pull(
name = "new_alpine_linux_armv6",
name = "new_alpine_linux_armv6_fixed_id",
architecture = "arm",
cpu_variant = "v6",
digest = "sha256:f29c3d10359dd0e6d0c11e4f715735b678c0ab03a7ac4565b4b6c08980f6213b",
os = "linux",
registry = "index.docker.io",
repository = "library/alpine",
tag = "3.8",
)

new_container_pull(
Expand All @@ -69,8 +70,10 @@ new_container_pull(
tag = "3.8",
)

# For testing, don't change the sha.
new_container_pull(
name = "new_distroless_base",
name = "new_distroless_base_fixed_id",
digest = "sha256:a26dde6863dd8b0417d7060c990abe85c1d2481541568445e82b46de9452cf0c",
registry = "gcr.io",
repository = "distroless/base",
)
Expand Down
22 changes: 11 additions & 11 deletions tests/container/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ file_test(
}
]
}""",
file = "@new_alpine_linux_armv6//image-oci:index.json",
file = "@new_alpine_linux_armv6_fixed_id//image-oci:index.json",
)

file_test(
Expand All @@ -464,28 +464,28 @@ file_test(
"manifests": [
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 737,
"digest": "sha256:edc3643ddf96d75032a55e240900b68b335186f1e5fea0a95af3b4cc96020b77"
"size": 444,
"digest": "sha256:a26dde6863dd8b0417d7060c990abe85c1d2481541568445e82b46de9452cf0c"
}
]
}""",
file = "@new_distroless_base//image-oci:index.json",
file = "@new_distroless_base_fixed_id//image-oci:index.json",
)

file_test(
name = "new_alpine_linux_armv6_test_oci_layout",
content = """{
"imageLayoutVersion": "1.0.0"
}""",
file = "@new_alpine_linux_armv6//image-oci:oci-layout",
file = "@new_alpine_linux_armv6_fixed_id//image-oci:oci-layout",
)

file_test(
name = "new_distroless_base_test_oci_layout",
content = """{
"imageLayoutVersion": "1.0.0"
}""",
file = "@new_distroless_base//image-oci:oci-layout",
file = "@new_distroless_base_fixed_id//image-oci:oci-layout",
)

# Merely testing for the presence of the pulled image.tar for now.
Expand All @@ -500,19 +500,19 @@ file_test(
content = """{
"imageLayoutVersion": "1.0.0"
}""",
file = "@new_alpine_linux_armv6//image-oci:oci-layout",
file = "@new_alpine_linux_armv6_fixed_id//image-oci:oci-layout",
)

# Testing for content of symlinks
file_test(
name = "new_distroless_base_oci_test_config_symlink",
file = "@new_alpine_linux_armv6//image:config.json",
file = "@new_alpine_linux_armv6_fixed_id//image:config.json",
regexp = "{\"architecture\":\"arm\",.*",
)

file_test(
name = "new_distroless_base_oci_test_0_tar_gz_symlink",
file = "@new_alpine_linux_armv6//image:0.tar.gz",
file = "@new_alpine_linux_armv6_fixed_id//image:0.tar.gz",
regexp = ".*",
)

Expand All @@ -533,7 +533,7 @@ container_image(

container_image(
name = "new_alpine_linux_armv6_image_oci_tar",
base = "@new_alpine_linux_armv6//image:image.tar",
base = "@new_alpine_linux_armv6_fixed_id//image:image.tar",
files = [
"//testdata:bar",
"//testdata:foo",
Expand All @@ -542,7 +542,7 @@ container_image(

container_image(
name = "new_alpine_linux_armv6_image_oci",
base = "@new_alpine_linux_armv6//image:image",
base = "@new_alpine_linux_armv6_fixed_id//image:image",
files = [
"//testdata:bar",
"//testdata:foo",
Expand Down

0 comments on commit b041d41

Please sign in to comment.