Skip to content

Commit

Permalink
Testing new indexed fields with dev image
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Dec 18, 2024
1 parent 182eded commit 096d290
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 42 deletions.
2 changes: 1 addition & 1 deletion shell/components/formatter/Endpoints.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default {
const nodeWithExternal = nodes.find((node) => !!node.externalIp) || {};
const externalIp = nodeWithExternal.externalIp;
if ( this.value && this.value.length ) {
if ( this.value?.length ) {
let out ;
try {
Expand Down
2 changes: 1 addition & 1 deletion shell/components/nav/TopLevelMenu.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const DEFAULT_SORT: Array<PaginationSort> = [
},
// {
// asc: true,
// field: 'status.conditions[0].status' // Pending API changes https://github.com/rancher/rancher/issues/48092
// field: 'status.conditions[0].status' // Pending API support https://github.com/rancher/rancher/issues/48092
// },
{
asc: true,
Expand Down
34 changes: 16 additions & 18 deletions shell/config/product/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,12 @@ export function init(store) {
[STATE, NAME_COL, NAMESPACE_COL, INGRESS_TARGET, INGRESS_DEFAULT_BACKEND, INGRESS_CLASS, AGE],
[
STEVE_STATE_COL,
STEVE_NAME_COL,
STEVE_NAMESPACE_COL,
{
...INGRESS_TARGET,
sort: 'spec.rules[0].host', // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
search: 'spec.rules', // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
sort: 'spec.rules[0].host', // Pending API support https://github.com/rancher/rancher/issues/48473 (index fields) --> https://github.com/rancher/rancher/issues/48384 (service crash)
search: false, // This is broken in normal world, so disable here
},
{
...INGRESS_DEFAULT_BACKEND,
Expand All @@ -292,7 +293,7 @@ export function init(store) {
{
...INGRESS_CLASS,
sort: 'spec.ingressClassName',
search: 'spec.ingressClassName', // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
search: 'spec.ingressClassName', // Pending API support (blocked https://github.com/rancher/rancher/issues/48473 (index fields) --> https://github.com/rancher/rancher/issues/48384 (service crash)
},
STEVE_AGE_COL
]
Expand All @@ -302,12 +303,9 @@ export function init(store) {
[STATE, NAME_COL, NAMESPACE_COL, TARGET_PORT, SELECTOR, SPEC_TYPE, AGE],
[
STEVE_STATE_COL,
STEVE_NAME_COL,
STEVE_NAMESPACE_COL,
{
...TARGET_PORT,
sort: 'spec.targetPort', // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
search: 'spec.targetPort', // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
},
TARGET_PORT,
{
// 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,
Expand All @@ -316,8 +314,8 @@ export function init(store) {
},
{
...SPEC_TYPE,
sort: 'spec.type', // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
search: 'spec.type', // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
sort: 'spec.type', // TODO: RC REGRESSION - shell/components/formatter/ServiceType.vue & shell/models/service.js show mangle value which we do not sort/filter on
search: 'spec.type',
},
STEVE_AGE_COL
]
Expand Down Expand Up @@ -357,17 +355,17 @@ export function init(store) {
STEVE_STATE_COL,
STEVE_NAME_COL,
STEVE_NAMESPACE_COL,
HPA_REFERENCE, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
MIN_REPLICA, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
MAX_REPLICA, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
CURRENT_REPLICA, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
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)
]
);

const STEVE_WORKLOAD_ENDPOINTS = {
...WORKLOAD_ENDPOINTS,
sort: [`metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]`], // Pending API support https://github.com/rancher/rancher/issues/48256
search: [`metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]`], // Pending API support https://github.com/rancher/rancher/issues/48256
sort: [`metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]`],
search: [`metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]`],
};

const createSteveWorkloadImageCol = (resourceFieldPos) => ({
Expand Down Expand Up @@ -507,8 +505,8 @@ export function init(store) {
},
{
...STORAGE_CLASS_DEFAULT,
sort: [`metadata.annotations[${ STORAGE.DEFAULT_STORAGE_CLASS }]`],
search: [`metadata.annotations[${ STORAGE.DEFAULT_STORAGE_CLASS }]`],
sort: [`metadata.annotations[${ STORAGE.DEFAULT_STORAGE_CLASS }]`], // Pending API Support - https://github.com/rancher/rancher/issues/48453
search: [`metadata.annotations[${ STORAGE.DEFAULT_STORAGE_CLASS }]`], // Pending API Support - https://github.com/rancher/rancher/issues/48453
},
STEVE_AGE_COL
]
Expand Down
4 changes: 2 additions & 2 deletions shell/config/table-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,8 @@ export const TARGET_PORT = {
formatter: 'ServiceTargets',
labelKey: 'tableHeaders.targetPort',
name: 'targetPort',
sort: `$['spec']['targetPort']`,
value: `$['spec']['targetPort']`,
sort: false,
value: false,
};

export const SELECTOR = {
Expand Down
33 changes: 15 additions & 18 deletions shell/plugins/steve/steve-pagination-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ class StevePaginationUtils extends NamespaceProjectFilters {
[MANAGEMENT.CLUSTER]: [
{ field: 'spec.internal' },
{ field: 'spec.displayName' },
// { field: `status.provider` }, // Pending API Support - https://github.com/rancher/rancher/issues/48256
// { field: `metadata.labels."${ CAPI_LABELS.PROVIDER }"` }, // Pending API Support - https://github.com/rancher/rancher/issues/48256
{ field: `status.provider` },
{ field: `metadata.labels."${ CAPI_LABELS.PROVIDER }"` },

],
[CONFIG_MAP]: [
Expand Down Expand Up @@ -175,19 +175,16 @@ class StevePaginationUtils extends NamespaceProjectFilters {
{ field: 'status.clusterName' },
],
[SERVICE]: [
// { field: 'spec.targetPort' }, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
// { field: 'spec.type' }, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
{ field: 'spec.type' },
],
[INGRESS]: [
// { field: 'spec.targetPort' }, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
// { field: 'spec.rules' }, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
// { field: 'spec.ingressClassName' }, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
// { field: 'spec.ingressClassName' }, // Pending API support (blocked https://github.com/rancher/rancher/issues/48473 (index fields) --> https://github.com/rancher/rancher/issues/48384 (service crash)
],
[HPA]: [
// { field: 'spec.scaleTargetRef.name' }, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
// { field: 'spec.minReplicas' }, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
// { field: 'spec.maxReplicas' }, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
// { field: 'spec.currentReplicas' }, // Pending API support https://github.com/rancher/rancher/issues/48103 (blocked https://github.com/rancher/rancher/issues/48384)
// { field: 'spec.scaleTargetRef.name' }, // Pending API support https://github.com/rancher/rancher/issues/48479 (hpa filtering)
// { field: 'spec.minReplicas' }, // Pending API support https://github.com/rancher/rancher/issues/48479 (hpa filtering)
// { field: 'spec.maxReplicas' }, // Pending API support https://github.com/rancher/rancher/issues/48479 (hpa filtering)
// { field: 'spec.currentReplicas' }, // Pending API support https://github.com/rancher/rancher/issues/48479 (hpa filtering)
],
[PVC]: [
{ field: 'spec.volumeName' },
Expand All @@ -198,25 +195,25 @@ class StevePaginationUtils extends NamespaceProjectFilters {
],
[STORAGE_CLASS]: [
{ field: 'provisioner' },
// { field: `metadata.annotations[STORAGE.DEFAULT_STORAGE_CLASS]` }, // Pending API support https://github.com/rancher/rancher/issues/48256
// { field: `metadata.annotations[STORAGE.DEFAULT_STORAGE_CLASS]` }, // Pending API Support - https://github.com/rancher/rancher/issues/48453
],
[CATALOG.APP]: [
// { field: 'spec.chart.metadata.name' }, // Pending API support https://github.com/rancher/rancher/issues/48256
{ field: 'spec.chart.metadata.name' }
],
[WORKLOAD_TYPES.CRON_JOB]: [
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // Pending API support https://github.com/rancher/rancher/issues/48256
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // Pending API support https://github.com/rancher/rancher/issues/48256 (index fields)
],
[WORKLOAD_TYPES.DAEMON_SET]: [
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // Pending API support https://github.com/rancher/rancher/issues/48256
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // Pending API support https://github.com/rancher/rancher/issues/48256 (index fields)
],
[WORKLOAD_TYPES.DEPLOYMENT]: [
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // Pending API support https://github.com/rancher/rancher/issues/48256
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // Pending API support https://github.com/rancher/rancher/issues/48256 (index fields)
],
[WORKLOAD_TYPES.JOB]: [
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // Pending API support https://github.com/rancher/rancher/issues/48256
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // Pending API support https://github.com/rancher/rancher/issues/48256 (index fields)
],
[WORKLOAD_TYPES.STATEFUL_SET]: [
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // Pending API support https://github.com/rancher/rancher/issues/48256
// { field: `metadata.annotations[CATTLE_PUBLIC_ENDPOINTS]` } // // Pending API support https://github.com/rancher/rancher/issues/48256 (index fields)
]

}
Expand Down
4 changes: 2 additions & 2 deletions shell/utils/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ export function paginationFilterOnlyKubernetesClusters(store) {

return PaginationParamFilter.createMultipleFields([
new PaginationFilterField({
field: `metadata.labels."${ CAPI.PROVIDER }"`, // Pending API Support - https://github.com/rancher/rancher/issues/48256
field: `metadata.labels."${ CAPI.PROVIDER }"`,
equals: false,
value: VIRTUAL_HARVESTER_PROVIDER,
exact: true
}),
new PaginationFilterField({
field: `status.provider`, // Pending API Support - https://github.com/rancher/rancher/issues/48256
field: `status.provider`,
equals: false,
value: VIRTUAL_HARVESTER_PROVIDER,
exact: true
Expand Down

0 comments on commit 096d290

Please sign in to comment.