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

Support for multiple AWS profiles #1548

Merged
merged 4 commits into from
Jun 7, 2019

Conversation

pranavgaikwad
Copy link
Contributor

Currently, velero does not support different credentials for different S3 buckets. The S3 connection established uses default profile. AWS SDK supports multiple profiles to be used. This change adds support for multiple profiles by introducing a new config variable in backup storage location definition. When a profile is not set explicitly by the user, AWS SDK automatically selects the default profile making this change not break existing configurations.

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
@dymurray
Copy link
Contributor

dymurray commented Jun 6, 2019

Pranav found this solution in reference to the issue I created awhile back: #1368. We are aware it does not completely solve the issue that mine was a duplicate from here: #1064 but it does allow someone using S3 to specify different profiles in a BSL. Please let us know if you have any concerns or feel this should be broadened to solve #1064.

@skriss
Copy link
Contributor

skriss commented Jun 6, 2019

This looks pretty reasonable to me. The one thing we do need to do is add code to use "default" as the profile if no profile is specified, for backwards compatibility. Thanks for the PR!

@pranavgaikwad
Copy link
Contributor Author

pranavgaikwad commented Jun 6, 2019

@skriss This change is already backward compatible. When the config variable is not present, the profile is simply passed as an empty string. AWS SDK then loads default profile from the credentials file. Here's relevant doc - https://docs.aws.amazon.com/sdk-for-go/v1/api/aws.session.Options.html

@skriss
Copy link
Contributor

skriss commented Jun 6, 2019

Ah, thanks, didn't realize that.

Copy link
Contributor

@skriss skriss left a comment

Choose a reason for hiding this comment

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

Code LGTM, just one documentation request.

@skriss
Copy link
Contributor

skriss commented Jun 7, 2019

@nrb @carlisia @prydonius please take a look as well.

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Copy link
Contributor

@skriss skriss left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@carlisia carlisia left a comment

Choose a reason for hiding this comment

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

👍

@carlisia carlisia merged commit bb12cbd into vmware-tanzu:master Jun 7, 2019
@pranavgaikwad pranavgaikwad deleted the mulAwsProfiles branch June 7, 2019 18:01
jessestuart added a commit to jessestuart/velero that referenced this pull request Jun 18, 2019
* upstream/master: (220 commits)
  Add restic instructions for Enterprise PKS (vmware-tanzu#1579)
  Adding Adnan to the team
  Discontinue use of excerpt separators in blog posts. (vmware-tanzu#1578)
  migrate PV snapshot tests
  migrate more backup action tests, remove obsolete test code (vmware-tanzu#1564)
  hide server commands in velero CLI (vmware-tanzu#1561)
  Fix test comparison
  remove glog (vmware-tanzu#1559)
  move issue-template-gen from docs/ to hack/ (vmware-tanzu#1558)
  update go-plugin to latest for bug fix (vmware-tanzu#1560)
  fix panic when processing DeleteBackupRequest objs without labels (vmware-tanzu#1556)
  Refactoring for backup item action tests (vmware-tanzu#1545)
  Support for multiple AWS profiles (vmware-tanzu#1548)
  add a link of velero plugin for alibabacloud to support-matrix docs
  fixes inlining of command in GCP setup docs (vmware-tanzu#1547)
  Signed-off-by: David Coons <coonsd@oregonstate.edu> (vmware-tanzu#1550)
  Add cmd to list plugins (vmware-tanzu#1535)
  Add ability to use wildcard in includes/excludes
  Initial pkg/backup test refactoring (vmware-tanzu#1532)
  Only run CI when relevant files have changed
  ...
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