Bug 1856354
| Summary: | New APIServices missing from OpenAPI definitions | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Paul Weil <pweil> | ||||||
| Component: | Management Console | Assignee: | Jon Jackson <jonjacks> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Yanping Zhang <yanpzhan> | ||||||
| Severity: | low | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 4.5 | CC: | aos-bugs, jboxman, jokerman, jonjacks, spadgett, yapei | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | 4.7.0 | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: |
Cause: OpenAPI definitions were only updated on initial page load.
Consequence: New OpenAPI definitions that were added by CRD were not reflected in the app until a page refresh.
Fix: Update OpenAPI definitions on a 5-minute interval and whenever we fetch models from the API.
Result: OpenAPI definitions stay up to date without a page refresh.
|
Story Points: | --- | ||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2021-02-24 15:13:58 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Paul Weil
2020-07-13 13:00:25 UTC
Will address next sprint. OpenAPI definitions are no longer stored in local storage as of https://github.com/openshift/console/pull/6227. We now rely on browser cache for optimization. This should still be an issue since we keep the definitions in memory and only refresh on console load. We'll need to fetch the document again after running API discovery. My mistake. At first glance at your PR, it looked like it would fix this, but now I see that it still only gets updated when `fetchSwagger` is called. Briefly looked into this, but haven't had a chance to dig in to it. Will address in upcoming sprint. Briefly looked into this, but haven't had a chance to dig in to it. Will address in upcoming sprint. Still haven't gotten to this yet. Did a little bit of exploration for possible approaches. Essentially, I think we are going to need a global watch to make sure that the schema definitions stay up to date. Still haven't had a chance to research a solution for this yet. (In reply to Jon Jackson from comment #7) > Still haven't gotten to this yet. Did a little bit of exploration for > possible approaches. Essentially, I think we are going to need a global > watch to make sure that the schema definitions stay up to date. Hey, Jon. We do have a global watch on API services that triggers an update to API discovery: https://github.com/spadgett/console/blob/d3fa4db55a58c1e4dbfc5d2c59b3b073653dbcfd/frontend/public/actions/k8s.ts#L281-L315 We might just want to refresh the OpenAPI doc whenever we call `getResources`. The endpoint uses ETags and browser caching, so there should be no significant overhead when the document hasn't changed. (In reply to Samuel Padgett from comment #9) > (In reply to Jon Jackson from comment #7) > > Still haven't gotten to this yet. Did a little bit of exploration for > > possible approaches. Essentially, I think we are going to need a global > > watch to make sure that the schema definitions stay up to date. > > Hey, Jon. We do have a global watch on API services that triggers an update > to API discovery: > > https://github.com/spadgett/console/blob/ > d3fa4db55a58c1e4dbfc5d2c59b3b073653dbcfd/frontend/public/actions/k8s.ts#L281- > L315 > > We might just want to refresh the OpenAPI doc whenever we call > `getResources`. The endpoint uses ETags and browser caching, so there should > be no significant overhead when the document hasn't changed. Great, thanks for the pointer. PR pending Checked on ocp 4.7 with payload: 4.7.0-0.nightly-2020-11-11-033756. Install etcd operator in project, then there is new api: EtcdCluster, EtcdBackup, EtcdRestore. In yaml creation, try to set kind using auto complete, but it doesn't show the new api in suggestion list. Refer to the screenshot. @Jon, if my steps are correct to check the bug? Created attachment 1728278 [details]
auto-complete-suggestion
Created attachment 1729883 [details]
Mock CRD with structural schema
(In reply to Yanping Zhang from comment #13) > Checked on ocp 4.7 with payload: 4.7.0-0.nightly-2020-11-11-033756. > Install etcd operator in project, then there is new api: EtcdCluster, > EtcdBackup, EtcdRestore. In yaml creation, try to set kind using auto > complete, but it doesn't show the new api in suggestion list. Refer to the > screenshot. > @Jon, if my steps are correct to check the bug? Yanping, I've attached a YAML file with a CRD that has a valid structural schema. You should be able to create this resource, then after a 10 second delay, it should populate in the suggestions for "kind" as "MockResource". The etcd CRDs do not have valid structural schemas, which is why they were not showing up. Thanks, Jon, the file works. Checked on ocp 4.7 cluster with payload 4.7.0-0.nightly-2020-11-12-200927. Created CRD "mock-resources.test.tectonic.com" with yaml in attachment, then create yaml, for "kind", input "Mo", and use ctrl+space key to show suggestion, there is "MockResource" shown in the list. The bug is fixed. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2020:5633 |