MCPcopy Create free account
hub / github.com/containers/image / deleteOneSignature

Method deleteOneSignature

docker/docker_image_dest.go:840–855  ·  view source on GitHub ↗

deleteOneSignature deletes a signature from sigURL, if it exists. If it successfully determines that the signature does not exist, returns (true, nil) NOTE: Keep this in sync with docs/signature-protocols.md!

(sigURL *url.URL)

Source from the content-addressed store, hash-verified

838// If it successfully determines that the signature does not exist, returns (true, nil)
839// NOTE: Keep this in sync with docs/signature-protocols.md!
840func (c *dockerClient) deleteOneSignature(sigURL *url.URL) (missing bool, err error) {
841 switch sigURL.Scheme {
842 case "file":
843 logrus.Debugf("Deleting %s", sigURL.Path)
844 err := os.Remove(sigURL.Path)
845 if err != nil && os.IsNotExist(err) {
846 return true, nil
847 }
848 return false, err
849
850 case "http", "https":
851 return false, fmt.Errorf("Writing directly to a %s lookaside %s is not supported. Configure a lookaside-staging: location", sigURL.Scheme, sigURL.Redacted())
852 default:
853 return false, fmt.Errorf("Unsupported scheme when deleting signature from %s", sigURL.Redacted())
854 }
855}
856
857// putSignaturesToAPIExtension implements PutSignaturesWithFormat() using the X-Registry-Supports-Signatures API extension,
858// for a manifest with manifestDigest.

Callers 2

deleteImageFunction · 0.80

Calls 1

RemoveMethod · 0.80

Tested by

no test coverage detected