From b041d415970f8d19594633274b4211d3f4b630e0 Mon Sep 17 00:00:00 2001 From: Xin Date: Fri, 12 Jul 2019 11:13:07 -0400 Subject: [PATCH] Pin containers that are used for digest tests. (#980) --- WORKSPACE | 11 +++++++---- tests/container/BUILD | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 7bcd4d16f..e10aa1acc 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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( @@ -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", ) diff --git a/tests/container/BUILD b/tests/container/BUILD index bbc03a761..8ec63d5b0 100644 --- a/tests/container/BUILD +++ b/tests/container/BUILD @@ -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( @@ -464,12 +464,12 @@ 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( @@ -477,7 +477,7 @@ 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", ) file_test( @@ -485,7 +485,7 @@ file_test( 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. @@ -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 = ".*", ) @@ -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", @@ -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",