Skip to content
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

do not attempt to set_object_acl for a bucket without ACLs when publishing on AWS #122

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MrBatschner
Copy link
Member

What this PR does / why we need it:

When publishing Garden Linux images to AWS, the code attempts to put_object_acl on the image blob in the buildresult bucket. If that bucket has ACLs disabled, it will print a the following warning:

2024-11-19 23:06:30,328 [WARNING] glci.aws: failed to set s3-blob to public - snapshot-import might fail
Traceback (most recent call last):
  File "/tmp/build/49900f65/git-gardenlinux.glci-rel-1592/glci/aws.py", line 488, in upload_and_register_gardenlinux_image
    s3_client.put_object_acl(
  File "/usr/lib/python3.11/site-packages/botocore/client.py", line 535, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/botocore/client.py", line 980, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (AccessControlListNotSupported) when calling the PutObjectAcl operation: The bucket does not allow ACLs

Even though just a warning, this output is confusing. This PR introduces a check if the bucket in question supports ACLs and will not issue the put_object_acl call if ACLs are not supported.

Release note:

Unnecessary warnings about failing `put_object_acl` calls are suppressed for buckets that do not support ACLs.

@MrBatschner MrBatschner requested review from a team as code owners November 20, 2024 16:21
@MrBatschner MrBatschner force-pushed the suppress_acl_warnings branch from 36f41a3 to 21d97f7 Compare November 20, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants