-
Notifications
You must be signed in to change notification settings - Fork 0
FIx: update network policy for deleting groups during updates #909
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
Conversation
…s for field, netmask, and group updates
rimu-stack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
напиши тест на это
… and updating policies with empty groups
| dto: NetworkPolicyUpdateDTO, | ||
| ) -> NetworkPolicyDTO: | ||
| """Update network policy.""" | ||
| policy = await self._network_policy_gateway.get_with_for_update(dto.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
может стоит внутри метода get_with_for_update сделать # NOTE: с небольшим описанием того, зачем используется .with_for_update() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
расписать что делает алхимический with_for_update? ИМХО избыточно
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нужна блокировка на запись(в целом with_for_update для этого и используют)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я про то, зачем нам здесь нужна блокировка. может несколько запрсоов на изменение прийти?
…th direct check for existing policies before committing changes
Починил логику update, раньше не рассматривался кейс, когда на обновление приходят путсые группы.
+немного отрефачил метод, а то сложно читать