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

Postpone policy recommendation scope watches until apiserver is up an… #2713

Merged
merged 3 commits into from
Jul 6, 2023

Conversation

rene-dekker
Copy link
Member

@rene-dekker rene-dekker commented Jul 4, 2023

Affects: EV-3878 EV-3861

Copy link
Contributor

@dimitri-nicolo dimitri-nicolo left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -65,6 +65,7 @@ func Add(mgr manager.Manager, opts options.AddOptions) error {
}
licenseAPIReady := &utils.ReadyFlag{}
tierWatchReady := &utils.ReadyFlag{}
policyRecScopeWatchReady := &utils.ReadyFlag{}
Copy link
Member

Choose a reason for hiding this comment

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

It seems like we should check this ready flag (like we do with the license and tier ones) before fetching the PolicyRecommendationScopes in the Reconcile.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, that's an important part of this - prevents us sending unnecessary requests to the apiserver and ensures we're using our cache to satisfy client queries.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, thank you.

Copy link
Member

@tmjd tmjd left a comment

Choose a reason for hiding this comment

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

LGTM

@rene-dekker rene-dekker merged commit cf39d0e into tigera:master Jul 6, 2023
@rene-dekker rene-dekker deleted the ev-3861 branch July 6, 2023 21:07
rene-dekker added a commit that referenced this pull request Jul 7, 2023
* Postpone policy recommendation scope watches until apiserver is up and running

* Block the policy recommendation controller if the apiserver watch is not established yet

* Mark readyFlag in unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants