diff --git a/src/common/k8s-api/kube-object.store.ts b/src/common/k8s-api/kube-object.store.ts index 309c183e42..13eb3e5fd7 100644 --- a/src/common/k8s-api/kube-object.store.ts +++ b/src/common/k8s-api/kube-object.store.ts @@ -12,7 +12,7 @@ import type { KubeJsonApiDataFor, KubeObject } from "./kube-object"; import { KubeStatus } from "./kube-object"; import type { IKubeWatchEvent } from "./kube-watch-event"; import { ItemStore } from "../item.store"; -import type { KubeApiQueryParams, KubeApi, KubeApiWatchCallback } from "./kube-api"; +import type { KubeApiQueryParams, KubeApi, KubeApiWatchCallback, ResourceDescriptor } from "./kube-api"; import { parseKubeApi } from "./kube-api-parse"; import type { RequestInit } from "node-fetch"; import type { Patch } from "rfc6902"; @@ -327,12 +327,12 @@ export abstract class KubeObjectStore< if (error) this.reset(); } - protected async loadItem(params: { name: string; namespace?: string }): Promise { + protected async loadItem(params: ResourceDescriptor): Promise { return this.api.get(params); } @action - async load(params: { name: string; namespace?: string }): Promise { + async load(params: ResourceDescriptor): Promise { const { name, namespace } = params; let item: K | null | undefined = this.getByName(name, namespace); @@ -356,11 +356,11 @@ export abstract class KubeObjectStore< return this.load({ name, namespace }); } - protected async createItem(params: { name: string; namespace?: string }, data?: PartialDeep): Promise { + protected async createItem(params: ResourceDescriptor, data?: PartialDeep): Promise { return this.api.create(params, data); } - async create(params: { name: string; namespace?: string }, data?: PartialDeep): Promise { + async create(params: ResourceDescriptor, data?: PartialDeep): Promise { const newItem = await this.createItem(params, data); assert(newItem, "Failed to create item from kube"); diff --git a/src/features/cluster/kube-object-views/roles/__snapshots__/add-new-role-dialog.test.tsx.snap b/src/features/cluster/kube-object-views/roles/__snapshots__/add-new-role-dialog.test.tsx.snap new file mode 100644 index 0000000000..fadf2f3460 --- /dev/null +++ b/src/features/cluster/kube-object-views/roles/__snapshots__/add-new-role-dialog.test.tsx.snap @@ -0,0 +1,5696 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Roles view/add new role dialog renders 1`] = ` + +
+
+
+