Commit 56ec7a9
committed
fix(source/cloud-sql-admin): validate source instance for backup-run restore
RestoreBackup's BackupRun-ID path consumes sourceProject + sourceInstance, but the guard required sourceProject + targetInstance. targetInstance is already mandatory for the RestoreBackup API call, so an empty source_instance slipped through and a malformed RestoreBackupContext{InstanceId:""} was sent. Validate sourceInstance, matching the tool parameter and docs that mark both source fields required when backup_id is a BackupRun ID. Adds a regression test case.1 parent 35c13ad commit 56ec7a9
2 files changed
Lines changed: 7 additions & 1 deletion
File tree
- internal/sources/cloudsqladmin
- tests/cloudsql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
| 415 | + | |
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
189 | 195 | | |
190 | 196 | | |
191 | 197 | | |
| |||
0 commit comments