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)
| 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! |
| 840 | func (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. |
no test coverage detected