-
Notifications
You must be signed in to change notification settings - Fork 21
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
Perform discovery API calls only as needed #39
Perform discovery API calls only as needed #39
Conversation
@dhaiducek and @JustinKuli I think this should help with the flaky tests. |
/hold the tests seem to have a lot of client throttling log messages so it may not work as I had hoped |
1d356e9
to
1d7d5b6
Compare
/unhold @JustinKuli and @dhaiducek I figured out a better approach. |
/hold for better error handling |
1d7d5b6
to
c931adb
Compare
/unhold |
@dhaiducek and @JustinKuli sorry for the noise. This is now ready for review. |
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.
How will we measure if this is better than the old implementation?
} | ||
} | ||
|
||
return schema.GroupVersionResource{}, false, fmt.Errorf("%w: %s", errNoVersionedResource, gvk.String()) |
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.
It might be nice to slightly distinguish between this error case and the NotFound case earlier. I can imagine a debug session from logs where these two cases being identical could be frustrating.
This commit changes the discovery REST mapper that was used to be targeted to that specific resource version. This is to reduce load on the Kubernetes API as well as to reduce the chance of long delays due to queries per second (QPS) exceeding the default limit. Signed-off-by: mprahl <mprahl@users.noreply.github.com>
65c055d
to
8f6a415
Compare
27f97d5
to
22a4613
Compare
This should address the flakiness. Signed-off-by: mprahl <mprahl@users.noreply.github.com>
Prior to this, dynamic watch library was instructed to watch constraints even when the corresponding ConstraintTemplate hadn't had a CRD generated yet. This caused the dynamic watch library to constantly refresh its discovery metadata, which is taxing to the Kubernetes API and can cause client throttling. Signed-off-by: mprahl <mprahl@users.noreply.github.com>
This will give us more control of how the events are sent and perhaps reduce flakiness. Signed-off-by: mprahl <mprahl@users.noreply.github.com>
22a4613
to
bd19f2d
Compare
Generating a REST mapper is very expensive on the Kubernetes API. This approach just gets the information needed for the particular watch request and then caches the information. This relates to this PR: open-cluster-management-io/governance-policy-framework-addon#39 Signed-off-by: mprahl <mprahl@users.noreply.github.com>
@dhaiducek and @JustinKuli note that if we merge this related PR, case12 would be much faster since it wouldn't cause the discovery information to be refreshed every time we try to create a watch on a Kind that does not exist: |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JustinKuli, mprahl The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Generating a REST mapper is very expensive on the Kubernetes API. This approach just gets the information needed for the particular watch request and then caches the information. This relates to this PR: open-cluster-management-io/governance-policy-framework-addon#39 Signed-off-by: mprahl <mprahl@users.noreply.github.com>
Generating a REST mapper is very expensive on the Kubernetes API. This approach just gets the information needed for the particular watch request and then caches the information. This relates to this PR: open-cluster-management-io/governance-policy-framework-addon#39 Signed-off-by: mprahl <mprahl@users.noreply.github.com>
…cy (open-cluster-management-io#39) Adds a label to policy templates that are created as a child of a policy, then compares the policy templates actually contained in that policy to all templates with the parent policy label to determine if templates have been renamed or removed from the parent. The template sync will then clean up any policy templates that are not being managed by the parent policy that created them. refs: - https://issues.redhat.com/browse/ACM-3049?filter=-1 Signed-off-by: Will Kutler <wkutler@redhat.com> (cherry picked from commit 2661cb2) Co-authored-by: Will Kutler <wkutler@redhat.com>
This commit changes the discovery REST mapper that was used to be targeted to
that specific resource version.
This is to reduce load on the Kubernetes API as well as to reduce the chance
of long delays due to queries per second (QPS) exceeding the default limit.
An additional commit was added to prevent watches being created on Gatekeeper constraints without the corresponding CRD installed.
Other commits are to address flaky tests.
Relates:
https://issues.redhat.com/browse/ACM-4518