Skip to content

gcp - spanner-backup - list backups by instance name - #11235

Open
Thanatos9404 wants to merge 1 commit into
cloud-custodian:mainfrom
Thanatos9404:gcp-spanner-backup-instance-name
Open

Thanatos9404 wants to merge 1 commit into
cloud-custodian:mainfrom
Thanatos9404:gcp-spanner-backup-instance-name

Conversation

@Thanatos9404

Copy link
Copy Markdown
Contributor

gcp.spanner-backup built the parent path for listing backups from the instance's displayName. The display name is a free-form label, so when it differs from the instance id the backups request goes to the wrong instance path. Usually that path doesn't exist and the policy fails; if the label matches another instance's id, that instance's backups are listed instead.

This maps the parent from the instance name (projects/<project>/instances/<id>) through child_enum_params, the same way spanner-database-instance does, and drops the override. It's the same fix #11228 makes for Bigtable.

I added a query test with hand-written flight data where the instance id and display name differ. It fails on main and passes with this change, and the rest of the c7n_gcp tests pass.

#10682 also edits the c7n.utils import here and still needs local_session, so whichever lands second needs a small rebase.

spanner-backup built the parent path from the instance displayName, so
for any instance whose display name differs from its id the backups
request went to the wrong instance path and the policy failed.

Map the parent from the instance name instead, as
spanner-database-instance already does. It is the full
projects/<project>/instances/<id> path, so the override that rebuilt it
from the default project and the display name is no longer needed.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant