Vedarth commented on code in PR #19028:
URL: https://github.com/apache/kafka/pull/19028#discussion_r2147522237


##########
docker/docker_build_test.py:
##########
@@ -69,16 +67,20 @@ def run_docker_tests(image, tag, kafka_url, image_type):
     parser.add_argument("image", help="Image name that you want to keep for 
the Docker image")
     parser.add_argument("--image-tag", "-tag", default="latest", dest="tag", 
help="Image tag that you want to add to the image")
     parser.add_argument("--image-type", "-type", choices=["jvm", "native"], 
default="jvm", dest="image_type", help="Image type you want to build")
-    parser.add_argument("--kafka-url", "-u", dest="kafka_url", help="Kafka url 
to be used to download kafka binary tarball in the docker image")
     parser.add_argument("--build", "-b", action="store_true", 
dest="build_only", default=False, help="Only build the image, don't run tests")
     parser.add_argument("--test", "-t", action="store_true", dest="test_only", 
default=False, help="Only run the tests, don't build the image")
+
+    archive_group = parser.add_mutually_exclusive_group(required=True)
+    archive_group.add_argument("--kafka-url", "-u", dest="kafka_url", 
help="Kafka url to be used to download kafka binary tarball in the docker 
image")
+    archive_group.add_argument("--kafka-archive", "-a", dest="kafka_archive", 
help="Kafka archive to be used to extract kafka binary tarball in the docker 
image")
+
     args = parser.parse_args()
 
     if args.build_only or not (args.build_only or args.test_only):
         if args.kafka_url:
-            build_docker_image(args.image, args.tag, args.kafka_url, 
args.image_type)
-        else:
-            raise ValueError("--kafka-url is a required argument for docker 
image")

Review Comment:
   I think we should still raise error when neither kafka-url nor kafka-archive 
is provided.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to