From bbd8ee7eb839682b7544357713da4df79ce68731 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Fri, 24 Jan 2025 15:38:08 +0000 Subject: [PATCH 1/4] Fix failure to fetch workload resources in monitoring chart install - with vai on the filter fields need to be defined - blocked on https://github.com/rancher/rancher/issues/48603 --- shell/chart/monitoring/index.vue | 2 +- shell/plugins/steve/steve-pagination-utils.ts | 24 +++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/shell/chart/monitoring/index.vue b/shell/chart/monitoring/index.vue index b3d39d76fd..14a6423d01 100644 --- a/shell/chart/monitoring/index.vue +++ b/shell/chart/monitoring/index.vue @@ -55,7 +55,7 @@ export default { async fetch() { const { $store } = this; - // Fetch all the resources required for all the tabs asyncronously up front + // Fetch all the resources required for all the tabs asynchronously up front const hashPromises = { namespaces: $store.getters['namespaces'](), pvcs: $store.dispatch('cluster/findAll', { type: PVC }), diff --git a/shell/plugins/steve/steve-pagination-utils.ts b/shell/plugins/steve/steve-pagination-utils.ts index 63afa39edb..bd275eae14 100644 --- a/shell/plugins/steve/steve-pagination-utils.ts +++ b/shell/plugins/steve/steve-pagination-utils.ts @@ -242,21 +242,31 @@ class StevePaginationUtils extends NamespaceProjectFilters { { field: 'spec.chart.metadata.name' } ], [WORKLOAD_TYPES.CRON_JOB]: [ - { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` } + { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 ], [WORKLOAD_TYPES.DAEMON_SET]: [ - { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` } + { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 ], [WORKLOAD_TYPES.DEPLOYMENT]: [ - { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` } + { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 ], [WORKLOAD_TYPES.JOB]: [ - { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` } + { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 ], [WORKLOAD_TYPES.STATEFUL_SET]: [ - { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` } - ] - + { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + ], + [WORKLOAD_TYPES.REPLICA_SET]: [ + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + ], + [WORKLOAD_TYPES.REPLICATION_CONTROLLER]: [ + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + ], } private convertArrayPath(path: string): string { From 2a518c33f81bc0d1aa1f13ef2dc4cbdd4dd3d794 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Wed, 5 Mar 2025 10:12:52 +0000 Subject: [PATCH 2/4] Update given BE progress --- shell/components/form/ResourceTabs/index.vue | 2 +- shell/config/product/explorer.js | 8 ++--- shell/plugins/steve/steve-pagination-utils.ts | 32 +++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/shell/components/form/ResourceTabs/index.vue b/shell/components/form/ResourceTabs/index.vue index 5a077c54e8..8f3875cbc7 100644 --- a/shell/components/form/ResourceTabs/index.vue +++ b/shell/components/form/ResourceTabs/index.vue @@ -195,7 +195,7 @@ export default { pagination.filters = []; } - const field = `involvedObject.uid`; // Pending API Support - https://github.com/rancher/rancher/issues/48603 + const field = `involvedObject.uid`; // TODO: RC TEST // of type PaginationParamFilter let existing = null; diff --git a/shell/config/product/explorer.js b/shell/config/product/explorer.js index 237adfc979..fad59176a2 100644 --- a/shell/config/product/explorer.js +++ b/shell/config/product/explorer.js @@ -283,7 +283,7 @@ export function init(store) { STEVE_NAMESPACE_COL, { ...INGRESS_TARGET, - sort: 'spec.rules[0].host', // Pending API support https://github.com/rancher/rancher/issues/48473 (index fields) + sort: 'spec.rules[0].host', // TODO: RC TEST search: false, // This is broken in normal world, so disable here }, { @@ -294,7 +294,7 @@ export function init(store) { { ...INGRESS_CLASS, sort: 'spec.ingressClassName', - search: 'spec.ingressClassName', // Pending API support (blocked https://github.com/rancher/rancher/issues/48473 (index fields) + search: 'spec.ingressClassName', // TODO: RC TEST }, STEVE_AGE_COL ] @@ -315,8 +315,8 @@ export function init(store) { }, { ...SPEC_TYPE, - sort: false, // ['spec.type', 'spec.clusterIP'] Pending API support (blocked https://github.com/rancher/rancher/issues/48473 (index fields) - search: 'spec.type', + sort: ['spec.type', 'spec.clusterIP'], // TODO: RC TEST + search: 'spec.type', // TODO: RC add search on clusterIp? }, STEVE_AGE_COL ] diff --git a/shell/plugins/steve/steve-pagination-utils.ts b/shell/plugins/steve/steve-pagination-utils.ts index bd275eae14..e3358bc7f3 100644 --- a/shell/plugins/steve/steve-pagination-utils.ts +++ b/shell/plugins/steve/steve-pagination-utils.ts @@ -194,7 +194,7 @@ class StevePaginationUtils extends NamespaceProjectFilters { { field: '_type' }, { field: 'reason' }, { field: 'involvedObject.kind' }, - // { field: 'involvedObject.uid' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + { field: 'involvedObject.uid' }, // TODO: RC TEST { field: 'message' }, ], [CATALOG.CLUSTER_REPO]: [ @@ -215,17 +215,17 @@ class StevePaginationUtils extends NamespaceProjectFilters { ], [SERVICE]: [ { field: 'spec.type' }, - // { field: 'spec.clusterIP' }, // Pending API support (blocked https://github.com/rancher/rancher/issues/48473 (index fields) + { field: 'spec.clusterIP' }, // TODO: RC TEST ], [INGRESS]: [ - // { field: 'spec.rules.host' }, // Pending API support (blocked https://github.com/rancher/rancher/issues/48473 (index fields) - // { field: 'spec.ingressClassName' }, // Pending API support (blocked https://github.com/rancher/rancher/issues/48473 (index fields) + { field: 'spec.rules.host' }, // TODO: RC TEST + { field: 'spec.ingressClassName' }, // TODO: RC TEST ], [HPA]: [ - // { field: 'spec.scaleTargetRef.name' }, // Pending API support https://github.com/rancher/rancher/issues/48473 (hpa filtering fix) - // { field: 'spec.minReplicas' }, // Pending API support https://github.com/rancher/rancher/issues/48473 (hpa filtering fix) - // { field: 'spec.maxReplicas' }, // Pending API support https://github.com/rancher/rancher/issues/48473 (hpa filtering fix) - // { field: 'spec.currentReplicas' }, // Pending API support https://github.com/rancher/rancher/issues/48473 (hpa filtering fix) + { field: 'spec.scaleTargetRef.name' }, // TODO: RC TEST + { field: 'spec.minReplicas' }, // TODO: RC TEST + { field: 'spec.maxReplicas' }, // TODO: RC TEST + { field: 'spec.currentReplicas' }, // TODO: RC TEST ], [PVC]: [ { field: 'spec.volumeName' }, @@ -236,36 +236,36 @@ class StevePaginationUtils extends NamespaceProjectFilters { ], [STORAGE_CLASS]: [ { field: 'provisioner' }, - // { field: `metadata.annotations[STORAGE.DEFAULT_STORAGE_CLASS]` }, // Pending API Support - https://github.com/rancher/rancher/issues/48453 + { field: `metadata.annotations[STORAGE.DEFAULT_STORAGE_CLASS]` }, // TODO: RC TEST ], [CATALOG.APP]: [ { field: 'spec.chart.metadata.name' } ], [WORKLOAD_TYPES.CRON_JOB]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 ], [WORKLOAD_TYPES.DAEMON_SET]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 ], [WORKLOAD_TYPES.DEPLOYMENT]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 ], [WORKLOAD_TYPES.JOB]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 ], [WORKLOAD_TYPES.STATEFUL_SET]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 ], [WORKLOAD_TYPES.REPLICA_SET]: [ - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 ], [WORKLOAD_TYPES.REPLICATION_CONTROLLER]: [ - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/48603 + // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 ], } From d870c07cf1785f1351825146e2392abb5d13f9e1 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Tue, 3 Jun 2025 13:20:25 +0100 Subject: [PATCH 3/4] Finish testing, fix search services, reference new rancher/rancher issues --- shell/components/form/ResourceTabs/index.vue | 2 +- shell/config/product/explorer.js | 29 +++++++++------- shell/plugins/steve/steve-pagination-utils.ts | 34 +++++++++---------- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/shell/components/form/ResourceTabs/index.vue b/shell/components/form/ResourceTabs/index.vue index 8f3875cbc7..cf6300b681 100644 --- a/shell/components/form/ResourceTabs/index.vue +++ b/shell/components/form/ResourceTabs/index.vue @@ -195,7 +195,7 @@ export default { pagination.filters = []; } - const field = `involvedObject.uid`; // TODO: RC TEST + const field = `involvedObject.uid`; // of type PaginationParamFilter let existing = null; diff --git a/shell/config/product/explorer.js b/shell/config/product/explorer.js index fad59176a2..7f1314b534 100644 --- a/shell/config/product/explorer.js +++ b/shell/config/product/explorer.js @@ -32,7 +32,7 @@ import { import { COLUMN_BREAKPOINTS } from '@shell/types/store/type-map'; import { STEVE_CACHE } from '@shell/store/features'; import { configureConditionalDepaginate } from '@shell/store/type-map.utils'; -import { CATTLE_PUBLIC_ENDPOINTS } from '@shell/config/labels-annotations'; +import { CATTLE_PUBLIC_ENDPOINTS, STORAGE } from '@shell/config/labels-annotations'; export const NAME = 'explorer'; @@ -283,7 +283,7 @@ export function init(store) { STEVE_NAMESPACE_COL, { ...INGRESS_TARGET, - sort: 'spec.rules[0].host', // TODO: RC TEST + sort: 'spec.rules[0].host', // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50526 search: false, // This is broken in normal world, so disable here }, { @@ -294,7 +294,7 @@ export function init(store) { { ...INGRESS_CLASS, sort: 'spec.ingressClassName', - search: 'spec.ingressClassName', // TODO: RC TEST + search: 'spec.ingressClassName', }, STEVE_AGE_COL ] @@ -305,8 +305,11 @@ export function init(store) { [ STEVE_STATE_COL, STEVE_NAME_COL, - STEVE_NAMESPACE_COL, - TARGET_PORT, + STEVE_NAMESPACE_COL, { + ...TARGET_PORT, + sort: false, + search: false, + }, { // Selector is an object. This is broken in non-SSP world anyway (won't sort on object, filtering on `$[x][y]` paths are broken ) ...SELECTOR, @@ -315,8 +318,8 @@ export function init(store) { }, { ...SPEC_TYPE, - sort: ['spec.type', 'spec.clusterIP'], // TODO: RC TEST - search: 'spec.type', // TODO: RC add search on clusterIp? + sort: ['spec.type'], + search: 'spec.type' }, STEVE_AGE_COL ] @@ -345,10 +348,10 @@ export function init(store) { STEVE_STATE_COL, STEVE_NAME_COL, STEVE_NAMESPACE_COL, - HPA_REFERENCE, // Pending API support https://github.com/rancher/rancher/issues/48479 (hpa filtering) - MIN_REPLICA, // Pending API support https://github.com/rancher/rancher/issues/48479 (hpa filtering) - MAX_REPLICA, // Pending API support https://github.com/rancher/rancher/issues/48479 (hpa filtering) - CURRENT_REPLICA, // Pending API support https://github.com/rancher/rancher/issues/48479 (hpa filtering) + HPA_REFERENCE, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50527 + MIN_REPLICA, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50527 + MAX_REPLICA, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50527 + CURRENT_REPLICA, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50527 STEVE_AGE_COL ] ); @@ -496,8 +499,8 @@ export function init(store) { }, { ...STORAGE_CLASS_DEFAULT, - sort: false, // [`metadata.annotations[${ STORAGE.DEFAULT_STORAGE_CLASS }]`], // Pending API Support - https://github.com/rancher/rancher/issues/48453 - search: false, // [`metadata.annotations[${ STORAGE.DEFAULT_STORAGE_CLASS }]`], // Pending API Support - https://github.com/rancher/rancher/issues/48453 + sort: [`metadata.annotations[${ STORAGE.DEFAULT_STORAGE_CLASS }]`], + search: [`metadata.annotations[${ STORAGE.DEFAULT_STORAGE_CLASS }]`], }, STEVE_AGE_COL ] diff --git a/shell/plugins/steve/steve-pagination-utils.ts b/shell/plugins/steve/steve-pagination-utils.ts index e3358bc7f3..ea3b10fd02 100644 --- a/shell/plugins/steve/steve-pagination-utils.ts +++ b/shell/plugins/steve/steve-pagination-utils.ts @@ -15,7 +15,7 @@ import { HPA, SECRET } from '@shell/config/types'; -import { CAPI as CAPI_LAB_AND_ANO, CATTLE_PUBLIC_ENDPOINTS } from '@shell/config/labels-annotations'; +import { CAPI as CAPI_LAB_AND_ANO, CATTLE_PUBLIC_ENDPOINTS, STORAGE } from '@shell/config/labels-annotations'; import { Schema } from '@shell/plugins/steve/schema'; import { PaginationSettingsStore } from '@shell/types/resources/settings'; import paginationUtils from '@shell/utils/pagination-utils'; @@ -194,7 +194,7 @@ class StevePaginationUtils extends NamespaceProjectFilters { { field: '_type' }, { field: 'reason' }, { field: 'involvedObject.kind' }, - { field: 'involvedObject.uid' }, // TODO: RC TEST + { field: 'involvedObject.uid' }, { field: 'message' }, ], [CATALOG.CLUSTER_REPO]: [ @@ -215,17 +215,17 @@ class StevePaginationUtils extends NamespaceProjectFilters { ], [SERVICE]: [ { field: 'spec.type' }, - { field: 'spec.clusterIP' }, // TODO: RC TEST + { field: 'spec.clusterIP' }, ], [INGRESS]: [ - { field: 'spec.rules.host' }, // TODO: RC TEST - { field: 'spec.ingressClassName' }, // TODO: RC TEST + { field: 'spec.rules.host' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50526 + { field: 'spec.ingressClassName' }, ], [HPA]: [ - { field: 'spec.scaleTargetRef.name' }, // TODO: RC TEST - { field: 'spec.minReplicas' }, // TODO: RC TEST - { field: 'spec.maxReplicas' }, // TODO: RC TEST - { field: 'spec.currentReplicas' }, // TODO: RC TEST + { field: 'spec.scaleTargetRef.name' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50527 + { field: 'spec.minReplicas' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50527 + { field: 'spec.maxReplicas' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50527 + { field: 'spec.currentReplicas' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50527 ], [PVC]: [ { field: 'spec.volumeName' }, @@ -236,36 +236,36 @@ class StevePaginationUtils extends NamespaceProjectFilters { ], [STORAGE_CLASS]: [ { field: 'provisioner' }, - { field: `metadata.annotations[STORAGE.DEFAULT_STORAGE_CLASS]` }, // TODO: RC TEST + { field: `metadata.annotations[${ STORAGE.DEFAULT_STORAGE_CLASS }]` }, ], [CATALOG.APP]: [ { field: 'spec.chart.metadata.name' } ], [WORKLOAD_TYPES.CRON_JOB]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 + { field: 'spec.template.spec.containers.image' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50526 ], [WORKLOAD_TYPES.DAEMON_SET]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 + { field: 'spec.template.spec.containers.image' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50526 ], [WORKLOAD_TYPES.DEPLOYMENT]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 + { field: 'spec.template.spec.containers.image' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50526 ], [WORKLOAD_TYPES.JOB]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 + { field: 'spec.template.spec.containers.image' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50526 ], [WORKLOAD_TYPES.STATEFUL_SET]: [ { field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` }, - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 + { field: 'spec.template.spec.containers.image' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50526 ], [WORKLOAD_TYPES.REPLICA_SET]: [ - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 + { field: 'spec.template.spec.containers.image' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50526 ], [WORKLOAD_TYPES.REPLICATION_CONTROLLER]: [ - // { field: 'spec.template.spec.containers.image' }, // Pending API Support - https://github.com/rancher/rancher/issues/49116 + { field: 'spec.template.spec.containers.image' }, // Pending API Support - BUG - https://github.com/rancher/rancher/issues/50526 ], } From dbd6d934c293c304473232ccfb7fcc860fc6a7a1 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Tue, 3 Jun 2025 14:21:52 +0100 Subject: [PATCH 4/4] Ensure services without pods selectors ignore fetching pods - docs say this is fine --- shell/models/service.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/models/service.js b/shell/models/service.js index ae17366e3a..6b86960d90 100644 --- a/shell/models/service.js +++ b/shell/models/service.js @@ -138,6 +138,11 @@ export default class Service extends SteveModel { } async fetchPods() { + if (!this.podRelationship) { + // If empty or not present, the service is assumed to have an external process managing its endpoints + return []; + } + return await this.$dispatch('findLabelSelector', { type: POD, matching: {