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
Refactor AWS db mocks #30086
Merged
Merged
Refactor AWS db mocks #30086
Conversation
This file contains 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
greedy52
added
refactoring
aws
Used for AWS Related Issues.
database-access
Database access related issues and PRs
labels
Aug 5, 2023
greedy52
requested review from
Tener,
gabrielcorado,
GavinFrazar and
smallinsky
August 5, 2023 20:05
greedy52
commented
Aug 5, 2023
@@ -809,6 +809,60 @@ func NewDatabasesFromRDSClusterCustomEndpoints(cluster *rds.DBCluster) (types.Da | |||
return databases, trace.NewAggregate(errors...) | |||
} | |||
|
|||
// NewDatabasesFromRDSCluster creates all database resources from an RDS Aurora | |||
// cluster. | |||
func NewDatabasesFromRDSCluster(cluster *rds.DBCluster) (types.Databases, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved logic from db fetcher to services
so it's easier for another package to do the same. no change.
GavinFrazar
approved these changes
Aug 6, 2023
greedy52
force-pushed
the
STeve/p471_discovered_db_url_validation_p15
branch
from
August 6, 2023 17:56
5d84d04
to
fd1238b
Compare
smallinsky
approved these changes
Aug 7, 2023
public-teleport-github-review-bot
bot
removed request for
Tener,
gabrielcorado and
fspmarshall
August 7, 2023 06:15
Tener
approved these changes
Aug 7, 2023
greedy52
added a commit
that referenced
this pull request
Aug 14, 2023
* Refactor AWS db mocks * removew lib/services dependency * fix rds instance url, add elasticache reader endpoint
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
aws
Used for AWS Related Issues.
database-access
Database access related issues and PRs
discovery
refactoring
size/md
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.
While working on UT for database URL checker, I found that I need to copy a lot of mock structs from db fetchers. Decided to make a separate change just for this refactor to make review easier.
Changes:
lib/cloud/mocks/aws.go
to individual files (lib/cloud/mocks/aws_xxx.go
) one per AWS service typerds.DBInstance
) from db fetch UTs tolib/cloud/mocks/aws_xxx.go
xxx.localhost
to valid AWS endpointsservices.NewXXX
to one.No logic change, just moving things around.