def METHOD_NAME(config, cli=False):
    """
    Perform basic validatation on the Cachito configuration.
    :param dict config: a dictionary of configuration values
    :param bool cli: a boolean that denotes if the configuration should be validated for the CLI
    :raises ConfigError: if the configuration is invalid
    """
    # Validate the required config variables
    for config_var in (
        "CACHITO_DEFAULT_PACKAGE_MANAGERS",
        "CACHITO_LOG_LEVEL",
        "CACHITO_MAX_PER_PAGE",
        "CACHITO_MUTUALLY_EXCLUSIVE_PACKAGE_MANAGERS",
        "CACHITO_LOG_FORMAT",
        "CACHITO_BUNDLES_DIR",
        "SQLALCHEMY_DATABASE_URI",
        "PROMETHEUS_METRICS_TEMP_DIR",
    ):
        if config_var == "CACHITO_BUNDLES_DIR":
            if cli:
                # Don't verify CACHITO_BUNDLES_DIR if this is coming from the CLI since it's not
                # used and requires the CACHITO_BUNDLES_DIR to exist. This is a hassle for hooks
                # in the deployments for OpenShift/Kubernetes.
                continue
            required_dir = config.get(config_var)
            if not required_dir or not os.path.isdir(required_dir):
                raise ConfigError(
                    f'The configuration "{config_var}" must be set to an existing directory'
                )
        elif config_var == "CACHITO_MUTUALLY_EXCLUSIVE_PACKAGE_MANAGERS":
            mutually_exclusive = config.get(config_var)
            if mutually_exclusive is None:
                raise ConfigError(f'The configuration "{config_var}" must be set')
            if not all(
                isinstance(pair, (tuple, list)) and len(pair) == 2 for pair in mutually_exclusive
            ):
                raise ConfigError(
                    f'All values in "{config_var}" must be pairs (2-tuples or 2-item lists)'
                )
        elif not config.get(config_var):
            raise ConfigError(f'The configuration "{config_var}" must be set')