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

Add Region to Connection Schemas + Use Region in Check Connection #7433

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

shirady
Copy link
Contributor

@shirady shirady commented Aug 6, 2023

Explain the changes

  1. Add region to connection schemas.
  2. Use region in check_aws_connection.

Issues: Fixed #xxx / Gap #xxx

  1. none

Testing Instructions:

Need to build with operator change noobaa/noobaa-operator#1188.

  1. Deploy noobaa on MInikube or Rancher Desktop (see guide).
    Note: nb is an alias that runs the local operator from build/_output/bin (alias created by devenv).
  2. Create namespacestore/backingstore and pass the region explicitly:
    nb namespacestore create aws-s3 <namespace-store-name> --region=<target-bucket-region>.
    nb backingstore create aws-s3 <backingstore-store-name> --region=<target-bucket-region>.
  3. Add printings to check_external_connection, check_aws_connection and see that the region passed.
    Note: test on buckets in the regions 'us-east-1' and 'us-west-1'.
  • Doc added/updated
  • Tests added

@shirady shirady requested a review from dannyzaken August 6, 2023 08:49
@pull-request-size pull-request-size bot added size/M and removed size/S labels Aug 14, 2023
@shirady shirady force-pushed the add-region-to-schema branch 2 times, most recently from 97901b8 to 2b86f59 Compare August 14, 2023 07:25
@pull-request-size pull-request-size bot added size/S and removed size/M labels Aug 14, 2023
@dannyzaken dannyzaken requested review from a team, tangledbytes and Neon-White and removed request for a team and tangledbytes August 14, 2023 08:59
Copy link
Contributor

@Neon-White Neon-White left a comment

Choose a reason for hiding this comment

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

Looks good, just one question - is there a reason that the region attribute is added to the connection only in update_external_connection and not in add_external_connection as well?

@shirady
Copy link
Contributor Author

shirady commented Aug 15, 2023

Looks good, just one question - is there a reason that the region attribute is added to the connection only in update_external_connection and not in add_external_connection as well?

@Neon-White, Would you please mark the line where you think I didn't add the region attribute?

I'll try to explain although I'm not sure what you meant exactly:
In add_external_connection schema the region was already set - see account.api lines 415-417:

region: {
type: 'string'
},

But in the function add_external_connection(req) we didn't extract the region from req, and I added it in line 717 (see it in the files changes, this was the original line):

let info = _.pick(req.rpc_params, 'name', 'endpoint', 'endpoint_type', 'aws_sts_arn');

and eventually, the info that would contain the region will be saved in the DB (we add the region to info and it will be saved under sync_credentials_cache):
await system_store.make_changes({
update: {
accounts: [{
_id: req.account._id,
$push: { sync_credentials_cache: info }
}]
}
});

@Neon-White
Copy link
Contributor

Thank you for the thorough explanation!

use region in check connection
pass region to update external connection

Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
@shirady shirady merged commit 3461ee9 into noobaa:master Aug 16, 2023
7 checks passed
@shirady shirady deleted the add-region-to-schema branch August 16, 2023 11:13
@shirady shirady mentioned this pull request Sep 13, 2023
2 tasks
@shirady shirady self-assigned this Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants