def METHOD_NAME(cfg: Config):
    """
    Download configuration packages used by the cluster.
    This function discovers packages which are used by parsing key `applications` in the
    hierarchy.
    """
    click.secho("Discovering config packages...", bold=True)
    cfg.inventory.ensure_dirs()
    pkgs = _discover_packages(cfg)
    pspecs = _read_packages(cfg, pkgs)
    for p in pkgs:
        pspec = pspecs[p]
        pdep = cfg.register_dependency_repo(pspec.url)
        pkg = Package(
            p,
            dependency=pdep,
            target_dir=package_dependency_dir(cfg.work_dir, p),
            version=pspec.version,
            sub_path=pspec.path,
        )
        if pkg.checkout_is_dirty() and not cfg.force:
            raise click.ClickException(
                f"Package {p} has uncommitted changes. "
                + "Please specify `--force` to discard them"
            )
        pkg.checkout()
        cfg.register_package(p, pkg)
        create_package_symlink(cfg, p, pkg)