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

Automated cherry pick of #6696: More robust system Tier creation / update (#6696) #6723

Conversation

antoninbas
Copy link
Contributor

Cherry pick of #6696 on release-2.1.

#6696: More robust system Tier creation / update (#6696)

For details on the cherry pick process, see the cherry pick requests page.

@antoninbas antoninbas added the kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release label Oct 8, 2024
@antoninbas

This comment was marked as outdated.

@antoninbas antoninbas closed this Oct 8, 2024
System Tier initialization should ideally wait for the Tier informer's
cache to sync before using the lister.  Otherwise we may think that the
system Tiers have not been created yet when in fact it is just the
informer that has not completed the initial List operation.

Additionally, we improve the logic in system Tier initialization:
* After every failed API call, we should probably check the state of the
  informer cache again (via the lister) and decide which step is needed
  next (creation / update / nothing). In case of a failed create or
  update, this gives us the opportunity to check again if the Tier
  actually exists, and if yes, what its priority is.
* AlreadyExists is no longer treated differently for create. The reason
  is that if the Tier already exists and for some reason it was not
  returned by the Lister, it will probably be the validation webhook
  that fails (overlapping priority), and the error won't match
  AlreadyExists.

Related to antrea-io#6694

Signed-off-by: Antonin Bas <[email protected]>
@antoninbas antoninbas reopened this Oct 8, 2024
@antoninbas antoninbas force-pushed the automated-cherry-pick-of-#6696-upstream-release-2.1 branch from de301cf to 6f4b170 Compare October 8, 2024 21:54
@antoninbas

This comment was marked as outdated.

@@ -320,7 +321,13 @@ func installHandlers(c *ExtraConfig, s *genericapiserver.GenericAPIServer) {

// Install a post start hook to initialize Tiers on start-up
s.AddPostStartHook("initialize-tiers", func(context genericapiserver.PostStartHookContext) error {
go c.networkPolicyController.InitializeTiers()
ctx := wait.ContextForChannel(context.StopCh)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the difference with the original commit 4edb5ec

Copy link
Member

@tnqn tnqn 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

@luolanzone luolanzone left a comment

Choose a reason for hiding this comment

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

LGTM, should this also be back-ported to 2.0?

@antoninbas
Copy link
Contributor Author

antoninbas commented Oct 9, 2024

LGTM, should this also be back-ported to 2.0?

Yes I'm working on backporting it to 2.0 and 1.15. I started with this PR only because it wasn't a "clean" backport.

@antoninbas
Copy link
Contributor Author

/test-kind-all

@antoninbas
Copy link
Contributor Author

/test-all

1 similar comment
@antoninbas
Copy link
Contributor Author

/test-all

@antoninbas antoninbas merged commit d5a6e01 into antrea-io:release-2.1 Oct 9, 2024
52 of 60 checks passed
@antoninbas antoninbas deleted the automated-cherry-pick-of-#6696-upstream-release-2.1 branch October 9, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants