def METHOD_NAME(
    cls,
    client: kubernetes.dynamic.DynamicClient,
    namespace: str,
    image: str,
) -> None:
    """
    Checks if the service is already using the given agent image. If it isn't using it then it changes the configmap
    to use it and restarts the deployment.
    """
    # Check if the service is already using the given agent image:
    current = cls._get_current_agent_image(client, namespace)
    if current == image:
        log.info(f"Service is already using agent image '{image}'")
        return
    # Update the configuration:
    configmaps_api = client.resources.get(api_version="v1", kind="ConfigMap")
    configmaps_api.patch(
        namespace=namespace,
        name="assisted-service-config",
        body={
            "data": {
                "AGENT_DOCKER_IMAGE": image,
            },
        },
    )
    log.info(f"Updated configuration with agent image '{image}'")
    # Restart the deployment:
    deployments_api = client.resources.get(api_version="apps/v1", kind="Deployment")
    date = datetime.datetime.now(datetime.timezone.utc).isoformat()
    deployments_api.patch(
        namespace=namespace,
        name="assisted-service",
        body={
            "spec": {
                "template": {
                    "metadata": {
                        "annotations": {
                            "kubectl.kubernetes.io/restartedAt": date,
                        },
                    },
                },
            },
        },
    )
    log.info(f"Restarted deployment with agent image '{image}'")