-
Notifications
You must be signed in to change notification settings - Fork 369
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
Automated cherry pick of #6696: More robust system Tier creation / update (#6696) #6723
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
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]>
de301cf
to
6f4b170
Compare
This comment was marked as outdated.
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) |
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.
This is the difference with the original commit 4edb5ec
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.
LGTM
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.
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. |
/test-kind-all |
/test-all |
1 similar comment
/test-all |
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.