def METHOD_NAME(cfg: Config):
    """
    Discover configuration packages used by the cluster in the inventory and register
    them if they're checked out in `inventory/classes`.
    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:
        pkg_dir = package_dependency_dir(cfg.work_dir, p)
        if not pkg_dir.is_dir():
            click.secho(
                f" > Skipping registration of package '{p}': repo is not available",
                fg="yellow",
            )
            continue
        pspec = pspecs[p]
        pdep = cfg.register_dependency_repo(pspec.url)
        pkg = Package(p, dependency=pdep, target_dir=pkg_dir, sub_path=pspec.path)
        cfg.register_package(p, pkg)
        create_package_symlink(cfg, p, pkg)