Commit Graph

175 Commits

Author SHA1 Message Date
Richard Cox ffcc08147e Ensure we back-off resyncWatch on socket resource.error
- if resource.error bad revision is recieved we http to get a new one
- in HA world this can still result in a watch with resource.error bad revision (given a stale replica handles watch)
- to avoid a tight loop, back-off the http request
2025-08-14 09:57:16 +01:00
Richard Cox 8c474ff64c Merge pull request #15011 from richard-cox/fix-resource-detail-updates
Fix general and specific resource detail watch issues
2025-08-07 10:14:46 +01:00
Evgeniya Vashkevich 6f21443dd4
[2.12.1] Fixed Harvester detail page access through Cluster Management (#15059) 2025-08-05 14:54:47 -07:00
Richard Cox eb1c08032f
Project Scoped Secrets (#14772)
* rename variables

* change button names + fix import

* apply pagination to secrets

* Major Changes

- secrets and project scoped secrets are now two pages
  - this fixes the issue where resource-fetch and associated mixins just fail with two of the same type on page
    - incremental loading would have been broken for both
- project scoped secrets
  - now correct lists upstream secrets that a project scoped based and on the target cluster
    - lots of work to get CRUD for management secrets in explore/cluster world
    - also includes a specific page to override the store for create/edit/view
  - these are now correctly grouped by project
  - updated to work with SSP enabled
- secrets list
  - shows if the secrets comes from a project
  - shows if the secret is a project scoped secret (only used on upstream cluster)
  - updated to work with SSP enabled
  - disabled update/delete of secrets created from project scoped (these just reset when sync runs again)
- disabled new detail view
  - this is broken, it ignores both storeOverride and currentStore, always going to `cluster` store


TODO:
- mostly testing
- blocked on some BE issues (bugs, additional indexed field)

* ... progress. will update commit message

* Revert "Merge pull request #14748 from richard-cox/revert-project-secrets"

This reverts commit be3962261d, reversing
changes made to 62d80084d9.

* tidy, and remove e2e

* test fixes

* fix vai group by

* Fix for grouping (secrets --> group by namespace --> pss --> table is incorrectly grouped but toggle is correct

* fix warning

* fix clone/yaml, fix default/system pss

* don't fetch projects, it wipes out header. this means in upstream we won't show project names for pss downstream

* fix lint

* fix ts complain

* Tweak column tooltips

* Add cypress logs for failing tests

* pipe in `inStore`

* tweaks to cypress logs process
- better name
- log http requests
- only create logs if run failed

* Secret selector improvements and test fixes
- don't cache or watch secrets if we're showing multiple selectors on a page
- ensure we classify secrets (make it into an instance of a model)

---------

Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
Co-authored-by: momesgin <mo.mesgin@suse.com>
2025-07-15 08:27:26 +01:00
Francesco Torchia 86ce58a6d9
Implement resource-class/_saveYaml unit tests
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2025-07-11 17:10:45 +02:00
Francesco Torchia ba0874ae8c
Implement normalize.test.ts
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2025-07-11 17:10:44 +02:00
Francesco Torchia 4b52e3f877
Handle conflict errors in resource-class.js/saveYaml PUT requests
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2025-07-11 17:10:43 +02:00
Francesco Torchia 9873120e9f
normalize/handleConflict refactoring
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2025-07-11 17:10:43 +02:00
Alexandre Alves 5552e0df54
replace `mergeWithReplace` and `merge` with `handleConflict` function on machine pools sync mechanism (#14431)
* replace mergeWithReplace and merge with handleConflict function on machine pools sync mechanism

* do proper deep copy of objects

* fix PR

* address pr comments

* skim down usecases data

* add mergeWithReplace usecases for unit tests on handleWithConflict

* add more usecases

* fix merge conflicts
2025-07-10 19:50:59 +01:00
Richard Cox 28c58ad5a1
Merge pull request #14674 from richard-cox/fix-stale-ns-filter
Ensure ns filter selection is updated when stale entries are removed
2025-07-04 09:47:04 +01:00
Richard Cox 2800ae04ec Ensure ns filter selection is updated when stale entries are removed
- when we calculate the value of a filter we remove entries that no longer exist
- ensure that this new version of the filter is persisted
- this means whilst on vai supported lists it correctly kicks off a http request
  - this also avoids removed namespaces being used in filters if the list changes

Also
- improved some comments
2025-07-03 15:15:29 +01:00
Richard Cox ce70f83265 Primary change - Fix and improve labelSelectors and vai auto updates
- labelSelector has two primary applicators
  - matching utils function
    - this should normally NOT be cached and not receive updates over sockets
    - this is done by stipulating transient = true
  - findLabelSelector
    - this should normally be cached and receive updates
    - this is done by stipulating transient = false
    - when applicable (workload and services detail page) we want live updates whilst we're on the page
      - we don't when we leave, so unwatch
- fix and align these two and their usages
  - ensure each input (transient) is correct for context
  - ensure response is in the correct format and handled correctly
- improved typing

Additionally
- Improve labelling for network policy ingress/egress label selectors
- Replace empty table with 'no details' in cis report detail page's list's sub row
- On services page handle the very weird use case of no visibility on pods
- Fix issue where extension catalog was not showing when refreshing on extension catalog page list
- Fixed an issue where we would ALWAYS show false positive invalid field warning in console
- Bump up default page size from 10k to 100k
  - this is for requests we make to the new vai cache outside of pages
  - it matches the default they use when proxying requests to target kube cluster
2025-07-03 14:25:37 +01:00
Richard Cox ac2042ca7b
Merge pull request #14514 from richard-cox/pagination-tweaks
SSP: Make deployments default workload list, unwatch resource when leaving lists
2025-06-23 09:14:03 +01:00
Richard Cox 30fd00bf0c When leaving a list, if we're paginated, forget it (clear cache, stop watches) 2025-06-20 10:23:45 +01:00
Cody Jackson 36e9876f23 Adding the new configmap detail page
fixes #13324
part of #13325
2025-06-19 00:40:57 -07:00
Francesco Torchia 2757e5cee3
Add subTypes option for mixed types count
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2025-06-18 11:15:39 +02:00
Richard Cox 75afc17979
Handle new vai-on updates to resources (#13150)
* port of wip

* asdassad

* Update vai / sql cache based api filtering to match latest changes

* Revert "Pin Rancher version to v2.11-2053ce644a31cd8053d1f58e2487154b0b8513b6-head for e2e tests"

This reverts commit 60f62107e7.

* sdfdsf

* dsfdsf

* asdsad

* fix dynamic hide local cluster changes

* improvements

* aaaa

* Working through todo's/tidys

* Remove debug / tidy up

* resolving todos

* remove some debug

* Tidying up #1

* Make manual refresh and auto-refresh visible on perf setting, disabled by default

* Remove dev stuff

* Fix some e2e tests

* Updated comment

* Wire in resource.changes debounce, clearer label for feature `listAutoRefreshToggle`

* Temporarily disable all watches when vai enable
- remove once rancher/rancher#40773 is resolved, which will then finally fix #12734

* Revert "Temporarily disable all watches when vai enable"

This reverts commit c708f468e4.

* Fix nextResourceVersion
- Ensure it handles resource revisions (in both LIST or individual resources) that are strings
- add unit tests

* Update after review
2025-06-11 18:11:35 +01:00
Richard Cox 138ab7783b Fix harvester machine config options
- machine config reaches out to specific downstream cluster with hardcoded urls
- vai on world needs to construct url with vai filters though
- previously these required cluster schemas (missing for cluster management pages)
- now they're schema missing safe
2025-05-29 15:55:19 +01:00
Richard Cox c446b7aff6 Merge remote-tracking branch 'upstream/master' into pagination-depaginate 2025-05-28 12:10:49 +01:00
Richard Cox 7bc66ab90d fix tests, more lint fixes 2025-05-28 12:05:48 +01:00
Richard Cox 980d4b06d9
Integrate new label select filtering (#12919)
* Test / Wire in new label filtering to limited places

- Wired in to
  - Workload detail page - pods and services (broken due to reverse selector)
  - Service Detail - Pods List
  - Service create/edit - Pod selector tab
- Also
  - Fix showPodRestarts in random location
- TODOs
  - Lots of testing / validation required
  - reverse deployment --> service selector (not services given deployment, but for each service contains pods from deployment)
  - workload model usages of pods getter
  - services model usages of pods getter
  - many many more....

* wired in, NOT tested

* improvement

* sdfdsf

* ryrty

* werer

* The great test off begins

* testing and tidying

* testing and tidying

* First good run

* tests, fixes and improvements

* updates

* Tidying up

* Fixes (namespace orientated), tweaks, updates

* Fix unit test

* Fixes for vai off

* Re-write `matching`
- handle namespaces better (given if the resource is namespaced
- better align with legacy matching fn (given specific scenarios that should return none or all)

* Lots of fixes, but mainly vai off --> pods list --> deployment detail --> pods list updates correctly

* fix lint, unit test

* e2e fix

* Fix weird plugins build validation failure (TS error on expected param for JS method with a default)

* Fix workload services

* changes following mini code review

* Only show pods tab if workload type supports it, always show pod resource table if tab is shown
2025-05-28 11:17:25 +01:00
Richard Cox 20e7af3e59 Merge remote-tracking branch 'upstream/master' into pagination-depaginate 2025-05-28 11:09:25 +01:00
Richard Cox c11db5c4a4 Updates following PR review
- gate incremental page by page number on is steve url + is steve cache enabled
- update incremental object property names, document
- remove fix for event lister errors
- add generic getters to help determine if steve behaviour should be used (getters will also be used in future PR)
2025-05-12 16:35:04 +01:00
Richard Cox 6fcc30a3bb Fix initial quickLoadCount query param 2025-05-12 13:59:25 +01:00
Richard Cox 573a6f630c Handle de-pagination, plus mimic non-vai default `limit` and avoid unlimited response count
- steve depaginate is used by cluster and project bindings, snapshots
2025-05-08 17:33:47 +01:00
Richard Cox 072afc8401 Remove undeeded e2e step, don't use page pagination if norman enabled 2025-05-07 17:51:12 +01:00
Richard Cox b47b48ddcf Support incremental loading when vai cache is enabled 2025-05-07 14:42:41 +01:00
Richard Cox 760bf41d3f tweaks 2025-04-10 10:35:34 +01:00
Richard Cox f0638e8aab Initial commit 2025-04-09 17:06:16 +01:00
Neil MacDougall 8001967416
Extensions: Add hooks to support virtual clusters (#11064)
* Add hooks to support virtual clusters

* Fix lint issues

* Refinements

* Update for Vue 3 changes

* Fix import

* Minor tweaks

* Fix bug causing e2e tests to fail

* Fix lint issue

* Rename internal properties and ensure they don't break clone/save

* Ensure we generate types for the plugins package to give us access to mapDriver

* Simpler approach

* Fix lint issues and add type

* Remove unused code

* Revery unnecessary changes

* Bug fix for finding model extension

* Factor out string constant and add provider display method

* Add experimental to API

* Update typegen.sh to use SHELL_DIR var

* Move type def

* Fix lint issue

* Address PR feedback

* Update steve-class.js so we always get an array

* Fix type definition
2025-01-31 08:51:58 +00:00
Richard Cox b614082ce1
Add server-side pagination to home page cluster list (#11663)
* Server-side pagination for home page clusters list and side bar clusters

- Functional Changes
  - SSP now works after vue3 bump
  - Home Page Clusters list now uses server-side pagination
  - Side Bar clusters list now uses server-side pagination
  - Wire in now supported sorting / filtering by id and name used for table columns
  - Allow pagination to be enabled given a specific context
  - Call findPage without persisting to store

- New Pagination Tools
  - PaginatedResourceTable - Convenience Component, wraps ResourceTable with pagination specific props
  - PaginationWrapper - Convenience class to handle requests for resources and updates to them (avoiding store)

- Regressions
  - Side Nav menu ready state was `mgmtCluster.isReady && !pCluster?.hasError`, now ???

* Iteration

Note - prov clusters is broken (only fetches local) due to blocking pr. breals
- notPinned list

* Fix dupe inStore
- remove from resource list, put in resource-fetch (used also by pag res table)

* Two fixes
- changes namespaces kicked of side nav cluster requests (thought pinnedIds changed)
- fix generic lists re-fetching given ns filter changes (they don't have namespaced arg)

* remove comment, backport fix

* test fixes

* E2E: Ensure we wait for cluster entries to exist before clicking on them

* backport fix for local/api filtering

* Remove debug code

* Changes after review

* e2e fixes / debugging

* More e2e fixes

* More e2e fixes

* More e2e fixes

* Fix generic pages that filter on pagination

* Attempt to fix flaky vai test

* Fix after merge from master

* Updates following new indexed files

* Fix lint and test

* Changes given real cluster tests
- general fixes
- correct issue were sorting prov clusters on mgmt cluster props (issue in master as well...)
- bit the bullet, we now don't fetch all mgmt clusters on dashboard visit.
  - there could be knock on affects, but we'd need to remove it sometime in 2.11....

* Fix issues with diplaying rke1 data in home page
- includes https://github.com/rancher/dashboard/pull/12881

* Fix unit tests
2025-01-03 15:34:28 +00:00
Phillip Rak 9cd6679ad8 Remove `markRaw()` from `map`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-12-12 12:27:38 -07:00
Francesco Torchia eac3deaa4b
Add harvester features
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-11-13 15:38:36 +01:00
Richard Cox 24f3a76580
Merge pull request #12171 from richard-cox/reactivity
Update model reactivety
2024-10-18 22:02:59 +02:00
Giuseppe Leo ab2244cf8e
Clone of global admin role not a 100% carbon copy (#12235)
* Add comment about the logic behind the goToClone methods

* Remove verbs key manipulation and map verbs with methods

* Add tests to ensure verbs are not manipulated

* Fix linters
2024-10-18 17:45:31 +02:00
Richard Cox 12fa019b53 Remove unused imports, improve const name 2024-10-09 13:40:00 +01:00
Richard Cox 4d56a7f20e Update model reactivety
- `reactive` was applied to objects that made it into the store via loadAll (or loadPage)
- objects that are assigned to a component `data` object should also be reactive
- however there are scenarios where changes to existing or new properties on these object did not trigger reactivity (computed, watch, etc)
- fix is two parts
  - Ensure all model instances that make it into the store are reactive
    - where we just stick something from `classify` straight into the store... wrap it with reactive
  - Ensure new properties added to a reactive object aren't ignored
    - in `replace` re-reactive the object if there's new properties
2024-10-08 15:41:42 +01:00
Cody Jackson a531b0d77e Making our models reactive
We got rid of reactivity when we remove Vue.set() I've added it back. In this case it's specifically to make the feature flags table reactive when activating and deactivating flags.
2024-08-22 16:09:56 -07:00
Phillip Rak e39ce7899f Resolve a batch of unit test failures
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:09:54 -07:00
cnotv ff08d80e0e Lint: Manually fixed issues related to vueApp variable added by the script 2024-08-22 16:07:03 -07:00
Cody Jackson 4bfb53c751 Fixing how we access the current route in our resource-class 2024-08-22 16:05:37 -07:00
Phillip Rak e207487074 Fix "$ctx" error when clicking login button
An error occurred logging in: proxy must report the same value for the non-writable, non-configurable property '"$ctx"'

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:05:37 -07:00
Cody Jackson 9b829c55ea Ran `yarn lint --fix` 2024-08-22 16:05:36 -07:00
Cody Jackson d5ce4fff2e Run the vue3 migration script
Commands run:

➤ yarn migrate
➤ git clean -fdx
➤ nvm use 20
➤ yarn
2024-08-22 16:05:36 -07:00
Richard Cox 08f05e229a Paginated Label Select Fixes
### No Options Shown
- Ensure all ResourceLabeledSelect attributes reach LabelSelect component
- This worked at some point, but $attrs now does not contain values that are defined as component props

### Cannot `Load More` options
- `Pages` param Missing in API response
- This has been removed, work around added

### Search term isn't matching partial results
- ensure exact filter matching is off
2024-07-23 12:10:53 +01:00
Richard Cox b34a57c3e3 Ensure count shown in side nav is correct
- A new `counts` getter was created to improve performance of the side nav (specifically Type component)
- This contained the functionality from
  - SideNav (count came from typemap 48d5695359 (diff-3ad9f7560480743de6a82ac01d6f961c5c8674095bf5a27c65287d4946b88fc3L1687))
  - Jump (count came from typemap AND itself 48d5695359 (diff-38a7ef0c623e19def1d9489f91f35089ceabf49da206a3fc298327d3eccfb584L44))
- Previously in both cases if all namespaces were selected it didn't pass in a list of namespaces when calculating the total count
- This was missed, so we were passing in a restrictive set of namespaces to the count
2024-07-16 13:49:34 +01:00
Richard Cox bfaf90e555
Merge pull request #11215 from richard-cox/limit-bindings
Add conditional depagination by native api, apply to bindings
2024-06-21 15:15:50 +01:00
Giuseppe Leo c36b071e40
Remove every reference to .nuxt global option (#11265)
* Remove unused rehydratation plugin

* Remove any reference to the .nuxt folders

* Remove globalApp nuxt and any reference or use case to nuxt.error

* Replace errors handling with existing fail-whale logic
2024-06-21 11:15:05 +02:00
Richard Cox ac4abfacc7 Fix norman cases which were attempting to call fetchResourceFields, revert type caps change 2024-06-12 13:22:21 +01:00
Richard Cox 3c84d2c0d7 Add conditional depagination by native api, apply to bindings
We could just set depaginate to true, however this would break management of members both explorer and cluster management side at scale.
Hopefully in 2.10.0 there'll be a permanent fix for this (server-side pagination)


Main change
- change depaginate type setting from boolean to boolean || function
- depaginate function will conditionally be true
- currently condition only supports limited depagination by a pre-defined count

In addition / supporint changes
- fix lookup of norman types settings (case sensative)
- fix currentProduct(resource) lookups for norman cluster and project roles
2024-06-12 12:42:07 +01:00