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

bug(obj): Fix temporary keys with long bucket names #1713

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

endocrimes
Copy link
Contributor

📝 Description

What does this PR do and why is this change necessary?

When bucket names are >34 characters, the createTempKeys function begins to fail, as linode requires that object storage access keys are <= 50 chars. This change truncates bucket names to 34 characters for that label when required.

In the future, it may be desirable to reduce the label further and add a suffix that implies a name was truncated, but I haven't found an existing pattern for that in this provider.

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?

  • Create a bucket with a long name (e.g banana-global-loving-skunk-loki-chunks) with Terraform and obj_use_temp_keys set.

How do I run the relevant unit/integration tests?

I haven't added a test for this explicitly as the obj resource_test is mildly tricky to setup for first time use, but if this change is desirable I can add one.

When bucket names are >34 characters, the `createTempKeys` function
begins to fail, as linode requires that object storage access keys are
<= 50 chars. This change truncates bucket names to 34 characters for
that label when required.

In the future, it may be desirable to reduce the label further and add a
suffix that implies a name was truncated, but I haven't found an
existing pattern for that in this provider.
@endocrimes endocrimes requested a review from a team as a code owner January 13, 2025 13:10
@endocrimes endocrimes requested review from lgarber-akamai and yec-akamai and removed request for a team January 13, 2025 13:10
Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

There might be a rare edge case where keys have duplicate labels but this shouldn't be a problem since duplicate key labels are allowed. Thank you for the contribution!

Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

Thank you for putting up the fix!

@zliang-akamai zliang-akamai merged commit 80c568b into linode:dev Jan 21, 2025
8 checks passed
@endocrimes endocrimes deleted the dani/bucket-temp-keys-length branch January 21, 2025 22:39
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.

4 participants