-
Notifications
You must be signed in to change notification settings - Fork 92
Description
What is the areas you experience the issue in?
Notation CLI
What is not working as expected?
When using Notation CLI to sign an artifact in OCI v1.0 compliant registries such as GHCR or registries that don't support deletion API (e.g. Docker Hub), Notation will return an unexpected error message and may mislead or confuse users. It happens when signing an artifact for the second time.
What did you expect to happen?
Improve the error message to be more descriptive and user-friendly, and tell users about the right result exactly. Giving an example: Successfully signed <registry>/<repository>@<digest>. Please note that Notation can't delete the referrers index since this is an OCI v1.0 compliant registry or the deletion API is disabled by the registry.
How can we reproduce it?
We have a user who signed a sample image in GHCR. It returned the following error message when this user signed the same image for the second time:
$ notation sign --signature-format cose --key $REMOTE_KEY_NAME ghcr.io/demo-user/python@sha256:xxxx
Error: failed to push signature to registry with error: failed to push manifest: failed to delete dangling referrers index sha256:xxx for referrers tag sha256-1ba1561: DELETE "https://ghcr.io/v2/demo-user/python/manifests/sha256:e1b7d6": response status code 405: unsupported: The operation is unsupported.
It may confuse users why this signing behavior failed due to an old referrers index manifest deletion failure. From an end user's point of view, the user is left with the impression that the signing failed. Now the user is left wondering why this happened and if she/he doesn't know the internals of OCI registries she/he may think the issue is with Notation.
In fact, the signing is successful and the signature has been attached to the image but it doesn't tell users the right result unless users view the referenced signatures using notation list as below.
ghcr.io/demo-user/python@sha256:xxxx
└── application/vnd.cncf.notary.signature
├── sha256:85f65b60a6e260d52ba5f8d556d444320b92c2ac140ec8d4944dbd8b03deb18c
└── sha256:96130e5a5e314ef90e56e24559e48065d2889c39661b9b3a944e6862e1e51c0a
Describe your environment
Ubuntu 20.08
What is the version of your Notation CLI or Notation Library?
Notation CLI v1.0.0-RC.3
Metadata
Metadata
Assignees
Labels
Type
Projects
Status