Skip to content

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

Description

@tomerschwartz24

Two of Skipper's remote-registry operations fail against a Harbor registry. Harbor's token service only accepts GET, and Harbor requires every repository to live under a project (<project>/<repo>), rejecting single-segment names — both stricter than some other registries.

1. skipper rmi -r fails with 405

utils.delete_image_from_registry issues the manifest DELETE through HttpBearerAuth. On the 401 Bearer challenge, requests_bearer fetches the token by copying the original request, so it sends DELETE to the token endpoint. Harbor's token service only accepts GET and answers with:

405 Method Not Allowed for url:
https://<registry>/service/token?service=harbor-registry&scope=repository:<repo>:delete

GET-based flows (images -r, digest fetch) copy GET and work, so only the delete path breaks.

2. skipper images -r crashes on non-namespaced names

Harbor rejects a single-segment repository name with 400 BAD_REQUEST: invalid repository name. get_remote_image_info only tolerates NAME_UNKNOWN/NOT_FOUND, so BAD_REQUEST raises RuntimeError and aborts the whole listing.

Fix

  • Obtain the bearer token for the manifest DELETE with an explicit GET against the challenge realm, then send the DELETE with the Authorization: Bearer header — never reusing the DELETE method for the token request.
  • Treat BAD_REQUEST like the other "nothing to list" codes: log a warning and skip that image instead of aborting images -r.

Verified against a Harbor registry: push, images -r, and rmi -r all succeed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions