Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions linodecli/plugins/obj/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

try:
import boto3
from botocore.config import Config
from botocore.exceptions import ClientError

HAS_BOTO = True
Expand Down Expand Up @@ -443,6 +444,16 @@ def _get_boto_client(cluster, access_key, secret_key):
aws_secret_access_key=secret_key,
region_name=cluster,
endpoint_url=BASE_URL_TEMPLATE.format(cluster),
config=Config(
# This addresses an incompatibility between boto3 1.36.x and
# some third-party S3-compatible storage platforms.
# In the future we may want to consider manually computing the
# CRC32 hash of a file before uploading it.
#
# See: https://github.com/boto/boto3/issues/4398#issuecomment-2619946229
request_checksum_calculation="when_required",
response_checksum_validation="when_required",
),
)

# set this for later use
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def _generate_test_file(

@pytest.fixture
def generate_test_files(
generate_test_file: Callable[[Optional[str], Optional[str]], Path]
generate_test_file: Callable[[Optional[str], Optional[str]], Path],
):
"""
Return a function that can generate files with random text.
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/image/test_plugin_image_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

# A minimal gzipped image that will be accepted by the API
TEST_IMAGE_CONTENT = (
b"\x1F\x8B\x08\x08\xBD\x5C\x91\x60\x00\x03\x74\x65\x73\x74\x2E\x69"
b"\x6D\x67\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00"
b"\x1f\x8b\x08\x08\xbd\x5c\x91\x60\x00\x03\x74\x65\x73\x74\x2e\x69"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was made implicitly by the formatter 🙂

b"\x6d\x67\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00"
)


Expand Down