-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
skip databases that are not available during auto discovery #10699
Conversation
lib/services/database.go
Outdated
// https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/accessing-monitoring.html | ||
switch aws.StringValue(instance.DBInstanceStatus) { | ||
|
||
// Statues marked as "Not billed" in the above guide. |
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.
// Statues marked as "Not billed" in the above guide. | |
// Statuses marked as "Not billed" in the above guide. |
@@ -44,14 +44,17 @@ func TestWatcher(t *testing.T) { | |||
rdsInstance2, _ := makeRDSInstance(t, "instance-2", "us-east-2", map[string]string{"env": "prod"}) | |||
rdsInstance3, _ := makeRDSInstance(t, "instance-3", "us-east-1", map[string]string{"env": "dev"}) | |||
rdsInstance4, rdsDatabase4 := makeRDSInstance(t, "instance-4", "us-west-1", nil) | |||
rdsInstanceUnavailable, _ := makeRDSInstance(t, "instance-5", "us-west-1", nil, rdsInstanceStatus("stopped")) |
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.
How about adding a test that explicitly verifies the behavior against unrecognized status, like "xxx-this-status-does-not-exist"?
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.
added
=== RUN TestWatcher/RDS_unavailable_databases_are_skipped
WARN[0000] Unknown status type: "status-does-not-exist". Assuming RDS instance "instance-5" is available.
WARN[0000] Unknown status type: "status-does-not-exist". Assuming Aurora cluster "cluster-5" is available.
=== RUN TestWatcher/skip_access_denied_errors
=== RUN TestWatcher/Redshift_labels_matching
=== RUN TestWatcher/Redshift_unavailable_databases_are_skipped
WARN[0000] Unknown status type: "status-does-not-exist". Assuming Redshift cluster "test" is available.
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.
Looking good!
Implements #10647
Testing