from typing import Dict
import json


def _load_image_name_to_version_map() -> Dict[str, str]:
    """
    _load_image_name_to_version_map returns a mapping of each image name
    to the corresponding version.

    e.g.
    {
        "mongodb-kubernetes-operator" : "0.7.2",
        "mongodb-agent" : "11.0.11.7036-1"
        ...
    }
    """
    with open("release.json") as f:
        release = json.loads(f.read())

    # agent section is a sub object, we change the mapping so the key corresponds to the version directly.
    release["mongodb-agent"] = release["mongodb-agent"]["version"]
    return release