Skip to content
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

Use destroy over delete for deleting unmapped routes #4100

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

Samze
Copy link
Contributor

@Samze Samze commented Nov 20, 2024

This triggers the deletion of associated resources, like labels and annotations.

Otherwise this operation gives a FK error.

destroy is required to do that as part of this definition https://github.com/cloudfoundry/cloud_controller_ng/blob/main/app/models/runtime/route.rb#L46 . Since this object has already excluded any route bindings or route mappings, using destroy has no effect on mappings/bindings.

Fixes #4099

Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:

  • A short explanation of the proposed change:

  • An explanation of the use cases your change solves

  • Links to any other associated PRs

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@Samze Samze force-pushed the 4099_fix_unmapped_route_deletion_with_labels branch from ef40bbc to 2293f9d Compare November 20, 2024 18:38
This triggers the deletion of associated resources, like
labels/annotations.

Otherwise this operation gives a FK error.
@Samze Samze force-pushed the 4099_fix_unmapped_route_deletion_with_labels branch from 2293f9d to 02a2200 Compare November 20, 2024 19:00
Copy link
Contributor

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@xandroc xandroc left a comment

Choose a reason for hiding this comment

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

👍🏽

@Samze Samze merged commit 53eb8d9 into main Nov 21, 2024
8 checks passed
@Samze Samze deleted the 4099_fix_unmapped_route_deletion_with_labels branch November 21, 2024 17:32
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Nov 22, 2024
Changes in cloud_controller_ng:

- Use destroy over delete for deleting unmapped routes
    PR: cloudfoundry/cloud_controller_ng#4100
    Author: Sam Gunaratne <[email protected]>

Dependency updates in cloud_controller_ng:

- build(deps-dev): bump rubocop-sequel from 0.3.6 to 0.3.7
    PR: cloudfoundry/cloud_controller_ng#4096
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

Deleting orphaned routes in a space fails if the routes have a label
4 participants