cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

:bug: fix: s3: fix bucket object not found

Open r4f4 opened this issue 1 year ago • 4 comments
trafficstars

What type of PR is this? /kind bug

What this PR does / why we need it: The s3.HeadObject API call can return "NotFound" when either the bucket or the object does not exist (as opposed to the more descriptive s3.ErrCodeNoSuchKey or s3.ErrCodeNoSuchBucket).

This would cause the machine controller to loop indefinitely trying to delete an already deleted object but failing:

    E0316 16:37:08.973942     366 awsmachine_controller.go:307] "unable to delete machine" err=<
            deleting bootstrap data object: deleting S3 object: NotFound: Not Found
                    status code: 404, request id: 5Z101DW1KN380WTY, host id: tYlSi9K38lBkIsr2DNf/xFfgDuFaVfeUmpscXdljiMZC5iRxPIDuXSLwHJwdFnosYCfi7Bih25GaDpVAbSq4ZA==
     >

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #4859

Special notes for your reviewer:

Checklist:

  • [ ] squashed commits
  • [ ] includes documentation
  • [X] includes emojis
  • [X] adds unit tests
  • [ ] adds or updates e2e tests

Release note:

Fix a bug where the machine controller will keep trying to delete an already deleted s3 object.

r4f4 avatar Mar 18 '24 15:03 r4f4