mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(rds): accept a ModifyDBSnapshot that names nothing to change (#8633)
ModifyDBSnapshot refused a request naming neither EngineVersion nor OptionGroupName with InvalidParameterCombination, "At least one snapshot attribute must be specified.", a message AWS does not use. The model requires only DBSnapshotIdentifier, and neither the API reference nor the User Guide's snapshot upgrade pages tie any error to a request with nothing to change, so such a request now returns the snapshot unchanged. A missing snapshot and one that is not available are still refused as before. The RDS docs record this as Floci's reading of an undocumented case. Closes #4083
This commit is contained in:
1 parent
a35fcfd9da
commit
16b0b516a0
4 files changed
+28
-10
No files matched your search
@@ -7552,9 +7552,28 @@ class RdsServiceTest {
|
||||
|
||||
assertEquals("14", modified.getEngineVersion());
|
||||
assertEquals("new-options", modified.getOptionGroupName());
|
||||
AwsException missingChange = assertThrows(AwsException.class, () ->
|
||||
rdsService.modifyDbSnapshot("mysnap", null, null, "us-east-1"));
|
||||
assertEquals("InvalidParameterCombination", missingChange.getErrorCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
void modifyDbSnapshotNamingNothingReturnsTheSnapshotUnchanged() {
|
||||
rdsService.createDbInstance("mydb", "postgres", "13",
|
||||
"admin", "password", "dbname", "db.t3.micro",
|
||||
20, false, null, null, null, null, false);
|
||||
when(containerManager.createPostgresSnapshot(any(), eq("admin"))).thenReturn("MOCK_DUMP_DATA");
|
||||
rdsService.createDbSnapshot("mysnap", "mydb");
|
||||
rdsService.modifyDbSnapshot("mysnap", "14", "new-options", "us-east-1");
|
||||
|
||||
DbSnapshot unchanged = rdsService.modifyDbSnapshot("mysnap", null, null, "us-east-1");
|
||||
|
||||
assertEquals("mysnap", unchanged.getDbSnapshotIdentifier());
|
||||
assertEquals("14", unchanged.getEngineVersion());
|
||||
assertEquals("new-options", unchanged.getOptionGroupName());
|
||||
DbSnapshot stored = rdsService.describeDbSnapshots("mysnap", null, "us-east-1").iterator().next();
|
||||
assertEquals("14", stored.getEngineVersion());
|
||||
assertEquals("new-options", stored.getOptionGroupName());
|
||||
AwsException missing = assertThrows(AwsException.class, () ->
|
||||
rdsService.modifyDbSnapshot("no-such-snap", null, null, "us-east-1"));
|
||||
assertEquals("DBSnapshotNotFound", missing.getErrorCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user