Repository navigation
snaprepoapi: Add Region field and WithRegion ctx - #136
Merged
Merged
Conversation
Contributor
Author
|
I could not for the love of god figure out why the * got body {"settings":{"region":"us-east-1","bucket":"mybucket","access_key":"myaccesskey","secret_key":"mysecretkey"},"type":"s3"}
, want {"settings":{"region":"us-east-1","bucket":"mybucket","access_key":"myaccesskey","secret_key":"mysecretkey"},"type":"s3"}😭 @marclop, do you have any ideas on why this is happening? |
3 of 10 tasks
Collaborator
|
@karencfv ah yes, I've run across this, you need to add |
marclop
approved these changes
Jun 11, 2020
marclop
left a comment
Collaborator
There was a problem hiding this comment.
Looks good! I thin that suggestion's going to fix the test
Co-authored-by: Marc Lopez Rubio <marc5.12@outlook.com>
Contributor
Author
|
@marclop thank you! |
12 tasks done
3 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This patch modifies all the snaprepoapi public functions to have a
Region string required parameter which is then used to create a new
context.Context: api.WithRegion(context.Background(), params.Region)
and pass it as the API operation context.
Unit tests have been modified to include a request
assertion which ensures that the region path interpolation is used when
the /platform APIs are being called.
The repository.go, repository_params.go and repository_test.go files have
been split and reorganised into multiple files each containing a single
API context and its parameters.
Related Issues
Related: #129
How Has This Been Tested?
unit tests in ecctl
Types of Changes
Readiness Checklist