Skip to content

Fix skipper rmi -r and images -r remote registry operations#194

Open
tomerschwartz24 wants to merge 1 commit into
upstreamfrom
harbor-registry-fixes
Open

Fix skipper rmi -r and images -r remote registry operations#194
tomerschwartz24 wants to merge 1 commit into
upstreamfrom
harbor-registry-fixes

Conversation

@tomerschwartz24

@tomerschwartz24 tomerschwartz24 commented Jul 2, 2026

Copy link
Copy Markdown

Fixes #193.

Three remote-registry operations failed against a Harbor registry (stricter than the previously used registry: its token service only accepts GET, and every repository must live under a namespace).

skipper rmi -r — 405 on the token endpoint

The manifest DELETE was routed through HttpBearerAuth, which fetches the bearer token by copying the original request method — sending DELETE to the token service, which Harbor only serves over GET (405). Now the token is fetched with an explicit GET against the challenge realm, then the DELETE is sent with the Authorization: Bearer header.

skipper rmi -r — namespaced images could not be addressed

Image validation only consulted Dockerfile.* names, which cannot contain a /, so a namespaced <namespace>/<image> was always rejected as "not an image of this project". Validation now also honors the containers config, matching images and build.

skipper images -r — crash on non-namespaced names

Harbor rejects a single-segment repository name with 400 BAD_REQUEST. get_remote_image_info only tolerated NAME_UNKNOWN/NOT_FOUND, so BAD_REQUEST raised and aborted the whole listing. It now skips the offending image with a warning.

Testing

  • Unit tests for each fix (token fetched via GET; namespaced image accepted from config; BAD_REQUEST tolerated; unknown errors still raise). Full suite: 116 passing.
  • Built and installed locally and run against a live Harbor registry: push, images -r, and rmi -r all succeed.

@tomerschwartz24 tomerschwartz24 force-pushed the harbor-registry-fixes branch from e425717 to 6acbe51 Compare July 2, 2026 12:08
@tomerschwartz24 tomerschwartz24 changed the title Fix skipper rmi -r and images -r against Harbor registry Fix skipper rmi -r and images -r remote registry operations Jul 2, 2026
@tomerschwartz24 tomerschwartz24 force-pushed the harbor-registry-fixes branch 2 times, most recently from b29c39c to c4318cc Compare July 2, 2026 12:45
Some registries (e.g. Harbor) run a token service that only accepts GET
and require every repository to live under a namespace, breaking three
remote-registry operations that worked against the previous registry.

rmi -r: the manifest DELETE was routed through HttpBearerAuth, which
fetches the bearer token by copying the original request method, sending
DELETE to the token endpoint (405). Fetch the token with an explicit GET
against the challenge realm, then send the DELETE with the resulting
Authorization: Bearer header.

rmi -r: image validation only consulted Dockerfile.* names, which cannot
contain a slash, so a namespaced <namespace>/<image> could never be
deleted. Honor the containers config as well, matching images and build.

images -r: a non-namespaced name is rejected with BAD_REQUEST, which
aborted the whole listing. Treat BAD_REQUEST like NAME_UNKNOWN/NOT_FOUND
and skip the offending image with a warning instead of raising.

Also drop the deprecated pkg_resources (removed from recent setuptools
and absent on Python 3.14): use importlib.metadata for the version and
locate packaged data via __file__, keeping the existing compatibility
floor (importlib_metadata backport for Python < 3.8). The build job
installs setuptools<81 so the released bootstrap skipper still imports.
@tomerschwartz24 tomerschwartz24 force-pushed the harbor-registry-fixes branch from efca33b to d33d9da Compare July 5, 2026 07:53

@roeigo-stratoscale roeigo-stratoscale left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run with @khizunov / @ofir-amir as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skipper rmi -r and images -r fail against Harbor registry

2 participants