From e389ddeed00139eaec9ca24689fa71079725d8ab Mon Sep 17 00:00:00 2001 From: Sahin Yort Date: Thu, 25 Jul 2024 23:56:30 +0300 Subject: [PATCH] test: add test for setting entrypoint to [] (#662) --- examples/assertion/BUILD.bazel | 37 +++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/examples/assertion/BUILD.bazel b/examples/assertion/BUILD.bazel index 8a9b0de7..0e43a186 100644 --- a/examples/assertion/BUILD.bazel +++ b/examples/assertion/BUILD.bazel @@ -421,7 +421,6 @@ assert_oci_config( image = ":case13", ) - # Case 14: created property should be epoch start oci_image( name = "case14", @@ -484,6 +483,42 @@ assert_oci_config( image = ":case15_cmd", ) +# Case 16: allow setting entrypoint to `[]` +# See: https://github.com/bazel-contrib/rules_oci/issues/336 +oci_image( + name = "case16_base", + architecture = "arm64", + cmd = [ + "-c", + "test", + ], + entrypoint = ["/bin/bash"], + os = "linux", +) + +assert_oci_config( + name = "test_case16_base", + cmd_eq = [ + "-c", + "test", + ], + entrypoint_eq = ["/bin/bash"], + image = ":case16_base", +) + +oci_image( + name = "case16", + base = ":case16_base", + entrypoint = [], +) + +assert_oci_config( + name = "test_case16", + cmd_eq = None, + entrypoint_eq = [], + image = ":case16", +) + # build them as test. build_test( name = "test",