Repository navigation
Conversation
… id field A request to IpamNamespaceDelete that sent "default" as id deleted the default namespace before the protection check moved to the node that the lookup returns. Add that request to the namespace delete cases, on the default branch and on a user branch, and add a changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eck rejects Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Before #11583, a user who could delete namespaces could delete the default IP namespace by sending its name in the
idfield:The old check compared the text in
idwith the UUID of the default namespace.find_objectthen looked up"default"with the default filter ofIpamNamespace(name__value), found the default namespace and deleted it.#11583 moved the check into
_delete_obj, which compares the UUID of the node that the lookup returns, sostablealready blocks this request. No test covered this request, and the changelog did not mention it.Closes #11633
What changed
test_protected_default_ipnamespaceandtest_delete_regular_ipnamespacenow also send the namespace name inid, on the default branch and on a user branch. Deleting the default namespace this way must return HTTP 422 with "Cannot delete default IPAM namespace" and leave the namespace in place. Deleting another namespace this way must delete it.NamespaceLookupenum (id,hfid,name-as-id) instead of theby_hfidboolean. The existing test IDs (by-id,by-hfid,by-id-user-branch,by-hfid-user-branch) do not change.changelog/11633.fixed.mdtells users that releases before this fix deleted the default namespace when a request sent its name asid.developwhenstableis merged into it, becausedevelopstill has the old check inmutate_delete.How to review
backend/tests/component/graphql/mutations/test_ipam.py: the case list and the_delete_ipnamespacehelper.How to test
With the
mutate_deletecheck from before #11583 put back temporarily,by-name-as-idandby-name-as-id-user-branchfail (ok: true). On this branch, all cases pass.Checklist
uv run towncrier create ...)🤖 Generated with Claude Code
Jira: IFC-3635