-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: allow azure blobs to not exist when deleting #11070
fix: allow azure blobs to not exist when deleting #11070
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Could you test it and verify the changes?
workflow/artifacts/azure/azure.go
Outdated
blobClient, err := containerClient.NewBlobClient(blobName) | ||
if err != nil { | ||
return fmt.Errorf("unable to create Azure Blob client for %s: %s", blobName, err) | ||
} | ||
|
||
_, err = blobClient.Delete(context.TODO(), nil) | ||
if err != nil { | ||
return fmt.Errorf("unable to delete Azure Blob %s: %s", blobName, err) | ||
if allowNonExistent && IsAzureError(err, azblob.StorageErrorCodeBlobNotFound) { | ||
log.Debugf("blob to delete '%s' does not exist (anymore): %s", blobName, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove "anymore"
Signed-off-by: Roel Arents <roel.arents@kadaster.nl>
2467884
to
958c6ff
Compare
Signed-off-by: Dirc <e.e.cornet@gmail.com>
fix fix: allow azure blobs to not exist when deleting
Hi @terrytangyuan, I have tested the change and added a small fix. This fixes the bug for @roelarents and me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Signed-off-by: Roel Arents <roel.arents@kadaster.nl> Signed-off-by: Dirc <e.e.cornet@gmail.com> Co-authored-by: Dirc <e.e.cornet@gmail.com> Co-authored-by: Yuan Tang <terrytangyuan@gmail.com>
Signed-off-by: Roel Arents <roel.arents@kadaster.nl> Signed-off-by: Dirc <e.e.cornet@gmail.com> Co-authored-by: Dirc <e.e.cornet@gmail.com> Co-authored-by: Yuan Tang <terrytangyuan@gmail.com>
Signed-off-by: Roel Arents <roel.arents@kadaster.nl> Signed-off-by: Dirc <e.e.cornet@gmail.com> Co-authored-by: Dirc <e.e.cornet@gmail.com> Co-authored-by: Yuan Tang <terrytangyuan@gmail.com> Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
Motivation
The docs say about artifact garbage collection:
However it is considered a failure at the moment. (At least for azure blobs.)
Modifications
Changed the azure implementation of the
ArtifactDriver
to swallowStorageErrorCodeBlobNotFound
errors from the azure client whenDelete
ing an artifact.Verification
I didn't test it yet.