Skip to content

Improve handling of missing schemas #13728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions shell/detail/node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,25 @@ export default {
},

async fetch() {
this.filterByApi = this.$store.getters[`cluster/paginationEnabled`](POD);
if (this.podSchema) {
this.filterByApi = this.$store.getters[`cluster/paginationEnabled`](POD);

if (this.filterByApi) {
if (this.filterByApi) {
// Only get pods associated with this node. The actual values used are from a get all in node model `pods` getter (this works as it just gets all...)
const opt = { // Of type ActionFindPageArgs
pagination: new FilterArgs({
sort: [{ field: 'metadata.name', asc: true }],
filters: PaginationParamFilter.createSingleField({
field: 'spec.nodeName',
value: this.value.id,
const opt = { // Of type ActionFindPageArgs
pagination: new FilterArgs({
sort: [{ field: 'metadata.name', asc: true }],
filters: PaginationParamFilter.createSingleField({
field: 'spec.nodeName',
value: this.value.id,
})
})
})
};
};

this.$store.dispatch(`cluster/findPage`, { type: POD, opt });
} else {
this.$store.dispatch('cluster/findAll', { type: POD });
this.$store.dispatch(`cluster/findPage`, { type: POD, opt });
} else {
this.$store.dispatch('cluster/findAll', { type: POD });
}
}

this.showMetrics = await allDashboardsExist(this.$store, this.currentCluster.id, [NODE_METRICS_DETAIL_URL, NODE_METRICS_SUMMARY_URL]);
Expand Down Expand Up @@ -97,6 +99,7 @@ export default {
VALUE,
EFFECT
],
podSchema,
podTableHeaders: this.$store.getters['type-map/headersFor'](podSchema),
NODE_METRICS_DETAIL_URL,
NODE_METRICS_SUMMARY_URL,
Expand Down Expand Up @@ -241,6 +244,7 @@ export default {
@update:value="$emit('input', $event)"
>
<Tab
v-if="podSchema"
name="pods"
:label="t('node.detail.tab.pods')"
:weight="4"
Expand Down
8 changes: 4 additions & 4 deletions shell/store/type-map.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ export function createHeaders(
} = columns;
const { rootGetters } = ctx;
const out = typeOptions.showState ? [stateColumn] : [];
const attributes = (schema.attributes as SchemaAttribute) || {};
const columnsFromSchema = attributes.columns || [];
const attributes = (schema?.attributes as SchemaAttribute) || {};
const columnsFromSchema = attributes?.columns || [];

// A specific list has been provided
if ( headers?.[schema.id]?.length ) {
return headers[schema.id].map((entry: any) => {
if ( headers?.[schema?.id]?.length ) {
return headers[schema?.id].map((entry: any) => {
if ( typeof entry === 'string' ) {
const col = findBy(columnsFromSchema, 'name', entry);

Expand Down
Loading