Skip to content

Some modules were uploaded to the repository but not pushed to the registry. #273

@suyiiyii

Description

@suyiiyii

Bug Report

Some modules were uploaded to the repository but not pushed to the registry.

1. Minimal reproduce step (Required)

k8s 1.32

uploaded to repo:

[package]
name = "k8s"
edition = "*"
version = "1.32"
description = "`k8s` is a KCL module contains all the built-in Kubernetes resource models (the CRDs are not included here)."

not pushed to the registry

https://github.com/orgs/kcl-lang/packages/container/package/k8s
Image

2. What did you expect to see? (Required)

the registry should sync with the repo

3. What did you see instead (Required)

4. What is your KCL components version? (Required)

N/A

i wrote a script to check which modules were not pushed

from dotenv import load_dotenv
import os
import oras.client
from pathlib import Path
import tomllib
import tqdm

load_dotenv()

SEARCH_PATH = Path("/Users/suyiiyii/Documents/git/kcl-modules")
TOKEN = os.getenv("TOKEN")

client = oras.client.OrasClient(auth_backend="token")
client.login(username="suyiiyii", password=TOKEN, hostname="ghcr.io")


def get_manifest(repository, tag) -> dict:
    try:
        container = f"ghcr.io/kcl-lang/{repository}:{tag}"
        c = client.get_container(container)
        r = client.get_manifest(container=c)
        return r
    except ValueError as e:
        if "Not Found" in str(e):
            return None
        else:
            raise e


paths = []

for path in SEARCH_PATH.rglob("*.mod"):
    if path.is_file() and path.name == "kcl.mod":
        paths.append(path)

print(f"Found {len(paths)} mod files")
for path in paths:
    print(path)

mis_modules = []
for path in tqdm.tqdm(paths):
    mod_ori = path.read_text()
    try:
        mod = tomllib.loads(mod_ori)
    except Exception as e:
        print(f"Error: {path}")
        raise e
    repository = mod["package"]["name"]
    tag = mod["package"]["version"]
    r = get_manifest(repository, tag)

    if r is None:
        mis_modules.append((path.absolute(), repository, tag))
    else:
        print(f"{repository}:{tag} exists mod file: {path.absolute()}")

print(mis_modules)

deps:

attrs==25.3.0
certifi==2025.1.31
charset-normalizer==3.4.1
idna==3.10
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
oras==0.2.27
python-dotenv==1.0.1
referencing==0.36.2
requests==2.32.3
rpds-py==0.23.1
tqdm==4.67.1
urllib3==2.3.0

PS: u need to use your own gh token and use your repo path

according to the results of running on my computer, these package are not pushed

"add-privileged-existing-namespaces", "0.1.0"
"svc-require-encryption-aws-loadbalancers", "0.1.1"
"deny-privileged-profile", "0.1.1"
"svc-require-encryption-aws-load-balancers", "0.1.1"
"psp-restrict-adding-capabilities", "0.0.1"
"k8s", "1.32"

i think this is a special case and i don't have permission to push the registry, so im providing the situation here as is

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions