From 0c33bb1092195f50aa652bdb6c7d31129b93a77a Mon Sep 17 00:00:00 2001 From: Flavian Missi Date: Tue, 30 May 2023 14:45:33 +0200 Subject: [PATCH] registry/storage/driver/azure: consider CannotVerifyCopySource as 404 Azure will return CannotVerifyCopySource with a 404 status code from a call to Move when the source blob does not exist. Details: https://learn.microsoft.com/en-us/rest/api/storageservices/blob-service-error-codes. This fixes the TestMoveNonexistent test case for the Azure driver. Signed-off-by: Flavian Missi --- registry/storage/driver/azure/azure.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/registry/storage/driver/azure/azure.go b/registry/storage/driver/azure/azure.go index 028239fd3..88aea274b 100644 --- a/registry/storage/driver/azure/azure.go +++ b/registry/storage/driver/azure/azure.go @@ -432,7 +432,13 @@ func (d *driver) blobName(path string) string { } func is404(err error) bool { - return bloberror.HasCode(err, bloberror.BlobNotFound, bloberror.ContainerNotFound, bloberror.ResourceNotFound) + return bloberror.HasCode( + err, + bloberror.BlobNotFound, + bloberror.ContainerNotFound, + bloberror.ResourceNotFound, + bloberror.CannotVerifyCopySource, + ) } type writer struct {