def METHOD_NAME(
    image_type: ImageType,
    image_builder_cls: Type[ContainerisedAgentBuilder],
    architecture: CpuArch,
    result_image_name: str,
    ready_image_oci_tarball: pl.Path = None,
    install_additional_test_libs: bool = True,
):
    """
    Get production image create it's testable version.
    For now, it adds just a coverage library as additional requirements, so our image
    tests can enable it in order to obtain coverage information of the docker/k8s related code.
    """
    image_builder = image_builder_cls()
    registry_container_name = "agent_image_e2e_test_registry"
    delete_container(container_name=registry_container_name)
    # Create temporary local registry to push production image there.
    subprocess.run(
        [
            "docker",
            "run",
            "-d",
            "--rm",
            "-p=5000:5000",
            f"--name={registry_container_name}",
            "registry:2",
        ],
        check=True,
    )
    try:
        all_image_tags = image_builder.generate_final_registry_tags(
            image_type=image_type,
            registry="localhost:5000",
            name_prefix="user",
            tags=["prod"],
        )
        # Publish image to the local registry
        image_builder.publish(
            image_type=image_type,
            tags=all_image_tags,
            existing_oci_layout_tarball=ready_image_oci_tarball,
            no_verify_tls=True,
        )
        prod_image_tag = all_image_tags[0]
        if install_additional_test_libs:
            # Build agent image requirements, because it also includes requirements (like coverage) for testing.
            requirement_libs_dir = image_builder.build_requirement_libs(
                architecture=architecture,
            )
            # Build testable image.
            buildx_build(
                dockerfile_path=_PARENT_DIR / "Dockerfile",
                context_path=_PARENT_DIR,
                architectures=[architecture],
                build_contexts={
                    "prod_image": f"docker-image://{prod_image_tag}",
                    "requirement_libs": str(requirement_libs_dir),
                },
                output=DockerImageBuildOutput(
                    name=result_image_name,
                ),
            )
        else:
            subprocess.run(
                [
                    "docker",
                    "pull",
                    prod_image_tag,
                ],
                check=True,
            )
            subprocess.run(
                [
                    "docker",
                    "tag",
                    prod_image_tag,
                    result_image_name,
                ],
                check=True,
            )
    finally:
        delete_container(container_name=registry_container_name)
    return result_image_name