Skip to content

Conversation

@huntergregory
Copy link
Contributor

@huntergregory huntergregory commented May 23, 2022

Any of the three controllers can call dp.ApplyDataPlane() at any time, so we have to be careful of this situation:

  • AddPolicy is called
  • an existing pod satisfies a policy's selector
  • ApplyDataPlane() is called after the selector IPSets are created, but before the network policy is applied

When applying ipsets to the kernel in Windows, we need to add/remove policies from pod endpoints based on whether the pod now satisfies or no longer satisfies a policy's selector. This change makes sure we don't try to add a policy that is "pending" (about to be added to the kernel) in dp.updatePod()

Once the pending policy is applied, then existing code already applies the policy to all necessary endpoints.

@huntergregory huntergregory added the npm Related to NPM. label May 23, 2022
@huntergregory huntergregory requested a review from a team as a code owner May 23, 2022 21:53
@huntergregory huntergregory requested review from ck319 and removed request for a team May 23, 2022 21:53
@vakalapa vakalapa merged commit b1ae762 into master May 25, 2022
@vakalapa vakalapa deleted the npm-win-add-policy-race branch May 25, 2022 16:36
matmerr pushed a commit to matmerr/azure-container-networking that referenced this pull request Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

npm Related to NPM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants