This repository has been archived by the owner on Mar 2, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's in this PR?
The
HEAD {{bucket}}
request allows querying the bucket's actual region without prior knowledge with the proper configuration.Unfortunately this behavior is not explicitly documented - or at least I couldn't find it - but the AWS SDK Go team confirmed in an issue comment this is an intended and supported behavior of the endpoint.
If the option runs into any issue, it has no effect on the session/configuration as a fallback mechanism. In such a case the plugin's behavior remains the same as before, namely falling back to the
HELM_S3_REGION
environment variable's value or to the corresponding AWS environment variable's value (AWS_REGION
orAWS_DEFAULT_REGION
).Why?
Without the correct region being set currently the plugin throws an error:
We wanted to allow the plugin to work without manual region setting and also support multiple repositories residing in different regions without updating the regions in-between fetching charts from those repositories. This is especially relevant when the plugin is used in a Terraform environment.
Additional context
The buckets used in the unit tests were found randomly, they are not mine and I do not have access to them, but they fit the test cases perfectly.
Checklist
User guide and development docs updated (if needed)Related Helm chart(s) updated (if needed)