Commit Graph

216 Commits

Author SHA1 Message Date
Neil MacDougall f6c80b295f
Add root product to improve performance of nav change within inExplorer products (#10447)
* Fix race condition in loadCluster

* Revert new error and comments

* Improve navigation performance for products within the explorer product

* Remove unused getter

* Fix issue with not loading nwe cluster when changing clusters

* Fix bug where sidenav take a short time to update (was using queueUpdate)

* Fix lint issues

* Address PR feedback
2024-03-28 09:28:23 +00:00
Richard Cox d6122779a2
Merge pull request #10669 from richard-cox/fix-node-spam
Handle resources that cannot be watched
2024-03-27 11:03:52 +00:00
Richard Cox 89d4eab4ca
Merge pull request #10455 from richard-cox/fix-dup-mgmt-setting-requests
Remove duplicate calls to mgmt settings on fresh load
2024-03-27 11:03:21 +00:00
Richard Cox 7f97317630 Better logging for failed plugin loads 2024-03-26 17:45:19 +00:00
Richard Cox a91f0303db Revert fixes for list vs individual watch handling
- 9318936c72
- BUG 1
  - Navigating from nodes list to a node detail page unwatches nodes list but doesn't watch new resources
  - Node's list destroy has a forgetType node
    - this removes entries from store and unwatches nodes list watch
    - we clear the fact we're watching the node list once we receieve a resource.stop from socket
  - There's a race condition, the node we're going to is still in the store... but the find action for this doesn't kick off a watch for the rsource
  - This was resolved by the change in the find action
- BUG 2
  - Refreshing on the detail page results in a watch for that specific node
  - Navigating to the list starts a watch for all nodes, but doesn't stop the individual watch
  - This was resolved by the change in subscribe
- HOWEVER
  - These fixes could impact how what we watch in other cases where we might call find all and find specific in the same context
  - Safer to address later
2024-03-26 16:59:14 +00:00
Richard 7ee02dd10c Add unit tests 2024-03-26 16:00:08 +00:00
Richard f4416cc647 Fix two more watch related node watch related bugs
1. Switching from a detail page with a watch on a specific resource to the list page where we watch all resources did not unwatch on the specific one
2. Switching to a detail page of a resource that's already in the store should ensure we're watching it
2024-03-26 16:00:08 +00:00
Richard Cox 230ad4d8f0 Handle resources that cannot be watched
- examples metrics.k8s.io.podmetrics, metrics.k8s.io.nodemetrics, componentstatus
- change 1
  - when these are watched the BE now sends an error... which we ignore and try to watch again
  - so handle the error
- change 2
  - avoid this scenario though by stopping watches that don't have the watch verb
  - because of this change 1 can only be tested by changing code
2024-03-26 16:00:08 +00:00
Richard Cox 64e3e923f6
Merge pull request #10480 from richard-cox/fix-pod-cache
Ensure pods loaded by incremental loadDataPage make it to the pod by namespace cache
2024-03-26 15:32:45 +00:00
Francesco Torchia 7653fbfa73
Fix vue-js-modal shell plugin
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-03-25 15:07:48 +01:00
Francesco Torchia e4a437f227
Revert vue-js-modal removal as required in Harvester
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-03-25 10:34:21 +01:00
Cody Jackson 9e5cce37da Factoring plugin installation out of index.js.
One of a series of changes to simplify the bootstrapping and authentication code.
2024-03-20 12:37:11 -07:00
Phillip Rak 4a9ce08614
Merge pull request #10591 from rak-phillip/feature/8207-modal-replace
Replace `vue-js-modal` with `app-modal`
2024-03-13 09:58:02 -07:00
Phillip Rak 15de4b701c Remove `vue-js-modal` dependency
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-03-12 15:37:44 -07:00
codyrancher b0d2dcbeb4
Vue 3 Nuxtism Removal (#10533)
* Removing everything related to scrollTrigger.

The latest vue router seems to behave exactly as it does with the modified scrollBehavior so it can all be removed.

* Removing unused $nuxt.{suffixes} that I found
- routeChanged  (didn't find any watches of this event)
- nbFetching (The only place reading this was a computed property which wasn't used anywhere)

* Replace the use of Vue[installKey]

* Removing some ssr rehydration code since we're not doing ssr

* Remove the remaining $nuxt.$on,$off,$emit and replace with the use of our primary store which already had related code

* Replacing usages of the .$nuxt on vue instances with globalApp references

* Removing SSR dead code

* Fixing an issue where extensions could still be referencing window.$nuxt. This now provides a deprecation warning.

* Migrating another $nuxt over to the window.$globalApp

* Removed the usage of Vue.config.$nux

* Removed the usage of Vue.util.defineReactive

- Saw that the Nuxt component wasn't needed any longer so I removed it instead of trying to work around Vue.util.defineReactive

* Re-run missing check

---------

Co-authored-by: cnotv <giuseppe.leo@suse.com>
2024-03-11 18:38:25 +01:00
Richard Cox 5ba075f891 Changes following review
- better comments
- improved tests
- handle trailing url `/`
2024-03-08 11:25:32 +00:00
Richard Cox 4fe1557511 Fix lint 2024-03-07 18:32:55 +00:00
Richard Cox e6f10b9924 Fix issue where on resource.error too old lots of resource watch events still happened
- caused because
  - resource.stop is sent alongside resource.error
  - on resource.error we set the state of the watch to errored
    - this was just using the root type as key and nothing else
  - on resource.stop we call resource.start
  - on resource.start we check for inError and bail if so
    - this didn't happen, as we checked the inError using more than just root type
- fix is to make sure setInError useds same key process as inError getter
  - this follows other places it's used
2024-03-07 18:06:25 +00:00
Richard Cox 01683ae8f4 Ensure `too old` messages for watches in individual resources are handled correctly
- also fix issue where `find` on `resyncWatch` didn't work with namespaced resources
2024-03-07 11:18:54 +00:00
Richard Cox 1fe8f7368d Add unit tests 2024-03-04 14:30:41 +00:00
Richard Cox 08f612eab7 Ensure pods loaded by incremental loadDataPage make it to the pod by namespace cached
- Also address a possible race condition made more likely by change
2024-03-04 14:30:41 +00:00
Neil MacDougall 3faa4ad729
Fix race condition in loadCluster (#10445)
* Fix race condition in loadCluster

* Revert new error and comments
2024-03-04 12:55:48 +00:00
Richard Cox 097a220225 Fix new, revealed issues. See PR for description 2024-02-29 17:30:26 +00:00
Richard Cox b464d15ee0
Integrate new schemaDefinitions endpoint (#10141)
* resource edit AS yaml

* fix cruresource (yaml from form)
- lazy load the schemaDefinitions when needed, avoids sync all to createYaml before we have an async chance to fetch schemaDefinitions

* Fix questions
- there are only four places we use questions, none of which use schema, this is just to be safe

* cluster scan, plugins/fieldsForDriver, defaultFor, validationErrors

* pathExistsInSchema
- used to optionally show conditions tab/list in resource detail view
- logs of things in ingress list/edit

* createPopulated / defaultFor
defaultFor requires resourceFields, it's only used by createPopulated in one place to support machine configs without components

* wip

* WIP MONITORING.SPOOFED
- these aren't spoofed types, but secondary schemas
- testing fix blocked, primary schema's have resourceFields

* Move steve specific (resourceField) code to steve models
- create models for steve schemas and apply to cluster and management stores
- move resoureField based validationto steve model
- move pathExistsInSchema to steve store getter
- don't fetch schemaDefinitions on start up when saving prefs (not needed and blocking)

* comments / improvements

* (untested) refactoring

* Fix alertmanager definitions, add retry definition fetch

* Fix pathExistsInSchema for path length > 2

* Fix questions that accept schemas
- tested by adding Questions to random page and the node schema

* Fix to saving configmap part 1
- the save works but doesn't show data. the yaml is the same as before. debug info added

* Validation by resourceFields is a norman specific thing, so make it such

* small refactor

* Tidying up

* Remove rebase junk

* fix linting and unit tests

* fix unit tests

* fix linting from fix for test....

* Tidying up, fix alertmanagerconfig

* Remove unit test todos

* add unit tests for resource fields

* sdssdf

* Add unit tests for pathExistsInSchema

* JS --> TS

* Store schemas in local singleton cache to avoid hitting store

* fix minor changes from review

* cruresource changes following review
- improvement - remove spurious canDiff
- createResourceYaml - pass in resource to use instead of calc in code

* WIP changes to parseType

* Fix generic cloud credential and node driver forms

* handle missing reactivity given schema definitions not in store

* fix and add unit tests for `parseType`

* Fix create-yaml test

* Changes following review
- improved comments
- SchemaDefinitionCache is now per store (and is reset as such)
- typeRef now uses parseType

* Fix dep loop by moving route based helps in auth out to utils file

* fix unit tests

* Changes following review
2024-02-28 17:08:35 +00:00
Richard Cox e90eb2a01b
Merge pull request #10413 from richard-cox/fix-label-selector
Fix issue where labelSelector param was incorrectly applied to filter param
2024-02-14 16:05:12 +00:00
Richard Cox 48d5695359 Improve getGroups performances
- Improve performance of allTypes fn
  - This consumed the majority of time within getGroups
  - Reduced execution time by a half
  - Change from running allTypes products * modes times, run it once per product
- Reduce the amount of times getGroups is called
2024-02-09 15:47:33 +00:00
Richard Cox b161ed7c6b
Merge pull request #10387 from richard-cox/fix-incremental-loading
Fix incremental loading
2024-02-08 09:42:34 +00:00
Richard Cox d69fefc867 Fix issue where labelSelector param was incorrectly applied to filter param
- the two fixes are small
- add unit tests to ensure
  - findMatching action calls urlFor with correct args
  - urlOptions getter create correct url given labelSelector
2024-02-06 17:17:16 +00:00
Richard Cox ba2ae401db - Incremental should be applied
- UI makes two requests
  - the initial incremental loading request (limit is 100 to show something quickly)
  - one more for actual incremental processing (limit is 1/4 of total). should be followed by another 3 requests for remaining resources
- What currently happens
  - url contains duplicated `?` in url leading to limit being ignored
  - both requests will fetch ALL resources
  - so x2 requests to fetch ALL resources
- what should happen
  - first request of 100 returns quickly, shows stuff on page
  - next request gets the first `next` url to iterate through pages
  - next three requests iterate through pages
2024-02-02 14:32:15 +00:00
LiuYan 66093f8a7c fix(steve/actions): fix import resource-utils failed 2024-02-02 09:03:08 +08:00
LiuYan 1458fffad4 test(resource-utils): add unit test for cleanForDownload method 2024-02-02 09:03:08 +08:00
Richard Cox f4c39fcb6c Wire in cleanForDownload per resource customisation to existing model cleanForX pattern
- base resource model has cleanForX style functions which specific resources override with their own custom neads
- wire in the cleanForDownload into this pattern
- add cleanForDownload override for secrets
2024-02-02 09:03:08 +08:00
LiuYan e172eef40c test(actions): add unit test for cleanForDownload action 2024-02-02 09:03:08 +08:00
LiuYan 73c7fc5f6f fix(steve/actions): fix missing type attribute of secret resource 2024-02-02 09:03:08 +08:00
Richard Cox ab5b0cf90b Avoid duplicate / surplus requests to fetch mgmt clusters
- loadManagement and loadCluster run in parallel
- both make requests to fetch mgmt clusters
- normally this is fine (loadManagement fetch finishes first, loadCluster requests then use that result)
- however in scenarios where there are a lot of clusters multiple requests are made
- we now wait for the loadManagmeent request to finish

Additionally
- make requests to correct (though harmless) url path (cluster --> clusters)
2024-01-17 15:51:10 +00:00
Nancy 4cca5faf81
AKS provisioning extension (#9669)
Adds a built-in AKS provisioning extension to replace the embedded ember pages, as well as modifications to the provisioning UI to support other non-rke2 provisioning extensions
2024-01-11 07:52:45 -08:00
Richard Cox 0368f657f0
Merge pull request #10037 from Shavindra/9371-remove-unwatned-properties
Removed unwanted properties from steve resources
2024-01-08 15:48:08 +00:00
Richard Cox aaba6b38a7 Include metadata clusterName, deletionPeriodSeconds and generateName properties in steve objects 2024-01-02 10:49:35 +00:00
Richard Cox cc9136b633 Fix unit tests (move mocks into utils folder) 2024-01-02 09:49:52 +00:00
Richard Cox aa6461802d improve unit tests, ensure super.cleanForSave's run correctly 2023-12-20 16:56:59 +00:00
Richard Cox aacf71b822 fix resource-class test 2023-12-20 16:10:51 +00:00
Richard Cox afa5feb3b4 fix workload test 2023-12-20 16:01:39 +00:00
Richard Cox d1a8b2f33b Refactoring and many fixes 2023-12-20 15:26:23 +00:00
cnotv 6bf041f7e5 Restore steve method fix deleting keys 2023-12-18 10:58:37 +01:00
Shavindra 2e69430808
Fix fleet cluster state (#10162)
* Display cluster state.

* Display cluster repo status badge.

* Fix typo.

* Fix typo.

* Fix linting.

* Fix linting.

* Removed type from request.

* Reverted change.
2023-12-18 10:52:11 +01:00
Alexandre Alves aa76d2d46c
remove page transitions from Dashboard (#10126)
* remove page transitions from Dashboard

* fix lint errors

* rename component rendered + fix issue where navigating from workloads to pods list view wasn't adjusting scroll

* rebase fixes

* address pr comments

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
2023-12-15 16:45:09 +00:00
cnotv bd11bde943 Add tests fir steve class model on save 2023-12-15 17:30:46 +01:00
cnotv 03dba9f064 Add test for resource class 2023-12-15 17:30:22 +01:00
Shavindra de550a86d4 Merge branch 'master' into 9371-remove-unwatned-properties 2023-12-14 23:17:59 +01:00
Neil MacDougall 83550bd0ca
Yaml Editor: Auto-fold section in RKE2 cluster config (#10108) 2023-12-14 13:22:44 +00:00