From d4632d5e340bab20b2aaefa5016ffbd0cfe4a49c Mon Sep 17 00:00:00 2001 From: Michael Nelson Date: Tue, 11 Aug 2020 11:52:30 +1000 Subject: [PATCH] Update operator instance routes (#1932) * Update operator instance routes. * Add info with link for operatorinstance views back to default cluster. * Remaining URLs switched to url helper. * Lint --- dashboard/src/components/AppList/AppList.tsx | 9 +++++++- .../src/components/AppList/AppListGrid.tsx | 9 +++++++- .../AppList/CustomResourceListItem.tsx | 12 ++++++++-- .../CustomResourceListItem.v2.test.tsx | 2 ++ .../AppList/CustomResourceListItem.v2.tsx | 4 +++- .../__snapshots__/AppList.test.tsx.snap | 1 + .../src/components/Catalog/Catalog.test.tsx | 3 +++ dashboard/src/components/Catalog/Catalog.tsx | 2 ++ .../src/components/Catalog/Catalog.v2.tsx | 7 +++++- .../components/Catalog/CatalogItem.test.tsx | 3 ++- .../src/components/Catalog/CatalogItem.tsx | 5 ++-- .../src/components/Catalog/CatalogItem.v2.tsx | 1 + .../components/Catalog/CatalogItems.test.tsx | 1 + .../src/components/Catalog/CatalogItems.tsx | 9 +++++--- .../Catalog/OperatorCatalogItem.tsx | 13 ++--------- .../__snapshots__/Catalog.test.tsx.snap | 2 ++ .../OperatorInstance.test.tsx | 7 ++++++ .../OperatorInstance/OperatorInstance.tsx | 7 +++++- .../OperatorInstanceForm.test.tsx | 8 +++++++ .../OperatorInstanceForm.tsx | 18 ++++++++++++--- .../OperatorInstanceUpdateForm.test.tsx | 8 +++++++ .../OperatorInstanceUpdateForm.tsx | 13 ++++++++--- .../OperatorInstanceCreateContainer.tsx | 1 + .../OperatorInstanceUpdateContainer.tsx | 1 + .../OperatorInstanceViewContainer.tsx | 1 + .../src/containers/RoutesContainer/Routes.tsx | 6 ++--- dashboard/src/shared/url.ts | 23 ++++++++++++++----- 27 files changed, 137 insertions(+), 39 deletions(-) diff --git a/dashboard/src/components/AppList/AppList.tsx b/dashboard/src/components/AppList/AppList.tsx index 17cf2274b1e..dcff3d2d675 100644 --- a/dashboard/src/components/AppList/AppList.tsx +++ b/dashboard/src/components/AppList/AppList.tsx @@ -168,7 +168,14 @@ class AppList extends React.Component { const csv = this.props.csvs.find(c => c.spec.customresourcedefinitions.owned.some(crd => crd.kind === r.kind), ); - return ; + return ( + + ); })} diff --git a/dashboard/src/components/AppList/AppListGrid.tsx b/dashboard/src/components/AppList/AppListGrid.tsx index 9d0f0ced43f..a5e5d9afee2 100644 --- a/dashboard/src/components/AppList/AppListGrid.tsx +++ b/dashboard/src/components/AppList/AppListGrid.tsx @@ -60,7 +60,14 @@ function AppListGrid(props: IAppListProps) { const csv = props.csvs.find(c => c.spec.customresourcedefinitions.owned.some(crd => crd.kind === r.kind), ); - return ; + return ( + + ); })} diff --git a/dashboard/src/components/AppList/CustomResourceListItem.tsx b/dashboard/src/components/AppList/CustomResourceListItem.tsx index d305865f881..409bc408ba3 100644 --- a/dashboard/src/components/AppList/CustomResourceListItem.tsx +++ b/dashboard/src/components/AppList/CustomResourceListItem.tsx @@ -1,5 +1,6 @@ import * as React from "react"; +import * as url from "shared/url"; import operatorIcon from "../../icons/operator-framework.svg"; import placeholder from "../../placeholder.png"; import { IClusterServiceVersion, IResource } from "../../shared/types"; @@ -7,13 +8,14 @@ import UnexpectedErrorPage from "../ErrorAlert/UnexpectedErrorAlert"; import InfoCard from "../InfoCard"; interface ICustomResourceListItemProps { + cluster: string; resource: IResource; csv: IClusterServiceVersion; } class CustomResourceListItem extends React.Component { public render() { - const { resource, csv } = this.props; + const { cluster, resource, csv } = this.props; const icon = csv.spec.icon ? `data:${csv.spec.icon[0].mediatype};base64,${csv.spec.icon[0].base64data}` : placeholder; @@ -29,7 +31,13 @@ class CustomResourceListItem extends React.Component { description: crd.description, icon: "placeholder.png", link: app.operatorInstances.view( + defaultProps.cluster, resource.metadata.namespace, csv.metadata.name, crd.name, diff --git a/dashboard/src/components/AppList/CustomResourceListItem.v2.tsx b/dashboard/src/components/AppList/CustomResourceListItem.v2.tsx index 7dd6b651a00..63ffa0e8888 100644 --- a/dashboard/src/components/AppList/CustomResourceListItem.v2.tsx +++ b/dashboard/src/components/AppList/CustomResourceListItem.v2.tsx @@ -8,12 +8,13 @@ import InfoCard from "../InfoCard/InfoCard.v2"; import Alert from "../js/Alert"; interface ICustomResourceListItemProps { + cluster: string; resource: IResource; csv: IClusterServiceVersion; } function CustomResourceListItem(props: ICustomResourceListItemProps) { - const { resource, csv } = props; + const { cluster, resource, csv } = props; const crd = findOwnedKind(csv, resource.kind); if (!crd) { // Unexpected error, CRD should be present if resource is defined @@ -28,6 +29,7 @@ function CustomResourceListItem(props: ICustomResourceListItemProps) { { id: "bar", name: "bar", namespace: "kubeapps", + cluster: "default", repo: { name: "bar", namespace: "chart-namespace", @@ -212,6 +213,7 @@ describe("renderization", () => { id: "foo", name: "foo", namespace: "kubeapps", + cluster: "default", repo: { name: "foo", namespace: "chart-namespace", @@ -247,6 +249,7 @@ describe("renderization", () => { id: "foo", name: "foo", namespace: "kubeapps", + cluster: "default", repo: { name: "foo", namespace: "chart-namespace", diff --git a/dashboard/src/components/Catalog/Catalog.tsx b/dashboard/src/components/Catalog/Catalog.tsx index 024aa539562..ba160690bff 100644 --- a/dashboard/src/components/Catalog/Catalog.tsx +++ b/dashboard/src/components/Catalog/Catalog.tsx @@ -199,6 +199,7 @@ class Catalog extends React.Component { description: c.attributes.description, repo: c.attributes.repo, namespace: this.props.namespace, + cluster: this.props.cluster, }, }); }); @@ -214,6 +215,7 @@ class Catalog extends React.Component { description: crd.description, csv: csv.metadata.name, namespace: this.props.namespace, + cluster: this.props.cluster, }, }); }); diff --git a/dashboard/src/components/Catalog/Catalog.v2.tsx b/dashboard/src/components/Catalog/Catalog.v2.tsx index e08edd3624e..b7945dfbeaf 100644 --- a/dashboard/src/components/Catalog/Catalog.v2.tsx +++ b/dashboard/src/components/Catalog/Catalog.v2.tsx @@ -148,7 +148,12 @@ function Catalog(props: ICatalogProps) { - + diff --git a/dashboard/src/components/Catalog/CatalogItem.test.tsx b/dashboard/src/components/Catalog/CatalogItem.test.tsx index f7588cb7378..34fa6eb9601 100644 --- a/dashboard/src/components/Catalog/CatalogItem.test.tsx +++ b/dashboard/src/components/Catalog/CatalogItem.test.tsx @@ -24,6 +24,7 @@ const defaultItem = { name: "repo-name", namespace: "repo-namespace", } as IRepo, + cluster: "default", namespace: "repo-namespace", icon: "icon.png", } as IChartCatalogItem; @@ -125,7 +126,7 @@ context("when the item is a catalog", () => { it("has the proper link", () => { const wrapper = shallow(); expect(wrapper.find(InfoCard).prop("link")).toEqual( - `/ns/${defaultItem.namespace}/operators-instances/new/foo-cluster/foo1`, + `/c/default/ns/${defaultItem.namespace}/operators-instances/new/foo-cluster/foo1`, ); }); }); diff --git a/dashboard/src/components/Catalog/CatalogItem.tsx b/dashboard/src/components/Catalog/CatalogItem.tsx index 8536cf2c267..617b0358fdc 100644 --- a/dashboard/src/components/Catalog/CatalogItem.tsx +++ b/dashboard/src/components/Catalog/CatalogItem.tsx @@ -14,6 +14,7 @@ export interface ICatalogItem { name: string; version: string; description: string; + cluster: string; namespace: string; icon?: string; } @@ -53,12 +54,12 @@ const CatalogItem: React.SFC = props => { }; const OperatorCatalogItem: React.SFC = props => { - const { icon, name, csv, version, description, namespace, id } = props; + const { icon, name, csv, version, description, cluster, namespace, id } = props; const iconSrc = icon || placeholder; // Cosmetic change, remove the version from the csv name const csvName = props.csv.split(".v")[0]; const tag1 = {csvName}; - const link = url.app.operatorInstances.new(namespace, csv, id); + const link = url.app.operatorInstances.new(cluster, namespace, csv, id); const subIcon = operatorIcon; const descriptionC = (
{trimDescription(description)}
diff --git a/dashboard/src/components/Catalog/CatalogItem.v2.tsx b/dashboard/src/components/Catalog/CatalogItem.v2.tsx index b200b5e5089..1161a3d460b 100644 --- a/dashboard/src/components/Catalog/CatalogItem.v2.tsx +++ b/dashboard/src/components/Catalog/CatalogItem.v2.tsx @@ -8,6 +8,7 @@ export interface ICatalogItem { name: string; version: string; description: string; + cluster: string; namespace: string; icon?: string; } diff --git a/dashboard/src/components/Catalog/CatalogItems.test.tsx b/dashboard/src/components/Catalog/CatalogItems.test.tsx index 2dbc901d076..f818103f524 100644 --- a/dashboard/src/components/Catalog/CatalogItems.test.tsx +++ b/dashboard/src/components/Catalog/CatalogItems.test.tsx @@ -47,6 +47,7 @@ const csv = { const defaultProps = { charts: [], csvs: [], + cluster: "default", namespace: "default", }; const populatedProps = { diff --git a/dashboard/src/components/Catalog/CatalogItems.tsx b/dashboard/src/components/Catalog/CatalogItems.tsx index 25e373beba3..7f11fc7be74 100644 --- a/dashboard/src/components/Catalog/CatalogItems.tsx +++ b/dashboard/src/components/Catalog/CatalogItems.tsx @@ -6,10 +6,11 @@ import CatalogItem, { ICatalogItemProps } from "./CatalogItem.v2"; interface ICatalogItemsProps { charts: IChart[]; csvs: IClusterServiceVersion[]; + cluster: string; namespace: string; } -export default function CatalogItems({ charts, csvs, namespace }: ICatalogItemsProps) { +export default function CatalogItems({ charts, csvs, cluster, namespace }: ICatalogItemsProps) { const chartItems: ICatalogItemProps[] = useMemo( () => charts.map(c => { @@ -23,11 +24,12 @@ export default function CatalogItems({ charts, csvs, namespace }: ICatalogItemsP version: c.relationships.latestChartVersion.data.app_version, description: c.attributes.description, repo: c.attributes.repo, + cluster, namespace, }, }; }), - [charts, namespace], + [charts, cluster, namespace], ); const crdItems: ICatalogItemProps[] = useMemo( () => @@ -45,6 +47,7 @@ export default function CatalogItems({ charts, csvs, namespace }: ICatalogItemsP version: crd.version, description: crd.description, csv: csv.metadata.name, + cluster, namespace, }, }; @@ -54,7 +57,7 @@ export default function CatalogItems({ charts, csvs, namespace }: ICatalogItemsP } }) .flat(), - [csvs, namespace], + [csvs, cluster, namespace], ); const sortedItems = chartItems diff --git a/dashboard/src/components/Catalog/OperatorCatalogItem.tsx b/dashboard/src/components/Catalog/OperatorCatalogItem.tsx index 26c7549a10f..9df69fe094d 100644 --- a/dashboard/src/components/Catalog/OperatorCatalogItem.tsx +++ b/dashboard/src/components/Catalog/OperatorCatalogItem.tsx @@ -6,22 +6,13 @@ import placeholder from "../../placeholder.png"; import InfoCard from "../InfoCard/InfoCard.v2"; import { IOperatorCatalogItem } from "./CatalogItem.v2"; -export interface ICatalogItem { - id: string; - name: string; - version: string; - description: string; - namespace: string; - icon?: string; -} - export default function OperatorCatalogItem(props: IOperatorCatalogItem) { - const { icon, name, csv, version, description, namespace, id } = props; + const { icon, name, csv, version, description, cluster, namespace, id } = props; const iconSrc = icon || placeholder; // Cosmetic change, remove the version from the csv name const csvName = props.csv.split(".")[0]; const tag1 = {csvName}; - const link = app.operatorInstances.new(namespace, csv, id); + const link = app.operatorInstances.new(cluster, namespace, csv, id); const subIcon = operatorIcon; return ( { + const props = { ...defaultProps, cluster: "other-cluster" }; + const wrapper = shallow(); + expect(wrapper.find(OperatorNotSupported)).toExist(); +}); + it("gets a resource when loading the component", () => { const getResource = jest.fn(); shallow(); diff --git a/dashboard/src/components/OperatorInstance/OperatorInstance.tsx b/dashboard/src/components/OperatorInstance/OperatorInstance.tsx index 72546c06f02..d1070bd7892 100644 --- a/dashboard/src/components/OperatorInstance/OperatorInstance.tsx +++ b/dashboard/src/components/OperatorInstance/OperatorInstance.tsx @@ -2,6 +2,7 @@ import { RouterAction } from "connected-react-router"; import * as yaml from "js-yaml"; import * as React from "react"; +import OperatorNotSupported from "components/OperatorList/OperatorsNotSupported"; import AccessURLTable from "../../containers/AccessURLTableContainer"; import ApplicationStatus from "../../containers/ApplicationStatusContainer"; import placeholder from "../../placeholder.png"; @@ -159,12 +160,16 @@ class OperatorInstance extends React.Component; + } const { resources } = this.state; const onUpdateClick = () => - push(app.operatorInstances.update(namespace, csvName, crdName, instanceName)); + push(app.operatorInstances.update(cluster, namespace, csvName, crdName, instanceName)); const error = errors.fetch || errors.delete || errors.update; return (
diff --git a/dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.test.tsx b/dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.test.tsx index 8bf96d7c570..8cbc4c8783d 100644 --- a/dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.test.tsx +++ b/dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.test.tsx @@ -1,3 +1,4 @@ +import OperatorNotSupported from "components/OperatorList/OperatorsNotSupported"; import { mount, shallow } from "enzyme"; import * as React from "react"; import OperatorInstanceForm from "."; @@ -9,6 +10,7 @@ const defaultProps: IOperatorInstanceFormProps = { csvName: "foo", crdName: "foo-cluster", isFetching: false, + cluster: "default", namespace: "kubeapps", getCSV: jest.fn(), createResource: jest.fn(), @@ -35,6 +37,12 @@ const defaultCSV = { }, } as any; +it("displays an alert if rendered for an additional cluster", () => { + const props = { ...defaultProps, cluster: "other-cluster" }; + const wrapper = shallow(); + expect(wrapper.find(OperatorNotSupported)).toExist(); +}); + it("retrieves CSV when mounted", () => { const getCSV = jest.fn(); shallow(); diff --git a/dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.tsx b/dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.tsx index bb85d3443bf..6b3c4725a36 100644 --- a/dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.tsx +++ b/dashboard/src/components/OperatorInstanceForm/OperatorInstanceForm.tsx @@ -3,6 +3,8 @@ import * as yaml from "js-yaml"; import { get } from "lodash"; import * as React from "react"; +import OperatorNotSupported from "components/OperatorList/OperatorsNotSupported"; +import * as url from "shared/url"; import { IClusterServiceVersion, IClusterServiceVersionCRD, IResource } from "../../shared/types"; import NotFoundErrorPage from "../ErrorAlert/NotFoundErrorAlert"; import OperatorInstanceFormBody from "../OperatorInstanceFormBody"; @@ -12,6 +14,7 @@ export interface IOperatorInstanceFormProps { csvName: string; crdName: string; isFetching: boolean; + cluster: string; namespace: string; getCSV: (namespace: string, csvName: string) => void; createResource: ( @@ -72,8 +75,11 @@ class DeploymentFormBody extends React.Component< } public render() { - const { isFetching, errors, csvName, crdName, namespace } = this.props; + const { isFetching, errors, csvName, crdName, cluster, namespace } = this.props; const { crd, defaultValues } = this.state; + if (cluster !== "default") { + return ; + } if (!errors.fetch && !isFetching && !crd) { return ( { - const { createResource, push, namespace, csv } = this.props; + const { createResource, push, cluster, namespace, csv } = this.props; const { crd } = this.state; if (!crd || !csv) { // Unexpected error, CRD and CSV should have been previously populated @@ -117,7 +123,13 @@ class DeploymentFormBody extends React.Component< const created = await createResource(namespace, resource.apiVersion, resourceType, resource); if (created) { push( - `/ns/${namespace}/operators-instances/${csv.metadata.name}/${crd.name}/${resource.metadata.name}`, + url.app.operatorInstances.view( + cluster, + namespace, + csv.metadata.name, + crd.name, + resource.metadata.name, + ), ); } }; diff --git a/dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.test.tsx b/dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.test.tsx index d612d2894c8..c725ad030c3 100644 --- a/dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.test.tsx +++ b/dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.test.tsx @@ -1,3 +1,4 @@ +import OperatorNotSupported from "components/OperatorList/OperatorsNotSupported"; import { mount, shallow } from "enzyme"; import * as React from "react"; import OperatorInstanceUpdateForm from "."; @@ -8,6 +9,7 @@ const defaultProps: IOperatorInstanceUpgradeFormProps = { csvName: "foo", crdName: "foo-cluster", isFetching: false, + cluster: "default", namespace: "kubeapps", resourceName: "my-foo", getResource: jest.fn(), @@ -24,6 +26,12 @@ const defaultResource = { }, } as any; +it("displays an alert if rendered for an additional cluster", () => { + const props = { ...defaultProps, cluster: "other-cluster" }; + const wrapper = shallow(); + expect(wrapper.find(OperatorNotSupported)).toExist(); +}); + it("gets a resource", () => { const getResource = jest.fn(); shallow(); diff --git a/dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.tsx b/dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.tsx index 1079ce9000e..1315cd0203e 100644 --- a/dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.tsx +++ b/dashboard/src/components/OperatorInstanceUpdateForm/OperatorInstanceUpdateForm.tsx @@ -2,6 +2,8 @@ import { RouterAction } from "connected-react-router"; import * as yaml from "js-yaml"; import * as React from "react"; +import OperatorNotSupported from "components/OperatorList/OperatorsNotSupported"; +import * as url from "shared/url"; import { IClusterServiceVersion, IResource } from "../../shared/types"; import NotFoundErrorPage from "../ErrorAlert/NotFoundErrorAlert"; import OperatorInstanceFormBody from "../OperatorInstanceFormBody"; @@ -11,6 +13,7 @@ export interface IOperatorInstanceUpgradeFormProps { csvName: string; crdName: string; isFetching: boolean; + cluster: string; namespace: string; resourceName: string; getResource: ( @@ -62,9 +65,13 @@ class DeploymentFormBody extends React.Component< } public render() { - const { isFetching, errors, resourceName, namespace, resource, csvName } = this.props; + const { isFetching, errors, resourceName, cluster, namespace, resource, csvName } = this.props; const { defaultValues } = this.state; + if (cluster !== "default") { + return ; + } + if (!errors.fetch && !isFetching && !resource) { return ; } @@ -88,7 +95,7 @@ class DeploymentFormBody extends React.Component< } private handleDeploy = async (resource: IResource) => { - const { updateResource, crdName, resourceName, namespace, push, csvName } = this.props; + const { updateResource, crdName, resourceName, cluster, namespace, push, csvName } = this.props; const created = await updateResource( namespace, @@ -98,7 +105,7 @@ class DeploymentFormBody extends React.Component< resource, ); if (created) { - push(`/ns/${namespace}/operators-instances/${csvName}/${crdName}/${resourceName}`); + push(url.app.operatorInstances.view(cluster, namespace, csvName, crdName, resourceName)); } }; } diff --git a/dashboard/src/containers/OperatorInstanceCreateContainer/OperatorInstanceCreateContainer.tsx b/dashboard/src/containers/OperatorInstanceCreateContainer/OperatorInstanceCreateContainer.tsx index 835a1c7952b..b15d2de2519 100644 --- a/dashboard/src/containers/OperatorInstanceCreateContainer/OperatorInstanceCreateContainer.tsx +++ b/dashboard/src/containers/OperatorInstanceCreateContainer/OperatorInstanceCreateContainer.tsx @@ -21,6 +21,7 @@ function mapStateToProps( { match: { params } }: IRouteProps, ) { return { + cluster: currentCluster, namespace: clusters[currentCluster].currentNamespace, isFetching: operators.isFetching, csv: operators.csv, diff --git a/dashboard/src/containers/OperatorInstanceUpdateContainer/OperatorInstanceUpdateContainer.tsx b/dashboard/src/containers/OperatorInstanceUpdateContainer/OperatorInstanceUpdateContainer.tsx index 1f6a9c6181e..abaeeeea106 100644 --- a/dashboard/src/containers/OperatorInstanceUpdateContainer/OperatorInstanceUpdateContainer.tsx +++ b/dashboard/src/containers/OperatorInstanceUpdateContainer/OperatorInstanceUpdateContainer.tsx @@ -22,6 +22,7 @@ function mapStateToProps( { match: { params } }: IRouteProps, ) { return { + cluster: currentCluster, namespace: clusters[currentCluster].currentNamespace, isFetching: operators.isFetching, csv: operators.csv, diff --git a/dashboard/src/containers/OperatorInstanceViewContainer/OperatorInstanceViewContainer.tsx b/dashboard/src/containers/OperatorInstanceViewContainer/OperatorInstanceViewContainer.tsx index e39011352d5..c4badcca0fc 100644 --- a/dashboard/src/containers/OperatorInstanceViewContainer/OperatorInstanceViewContainer.tsx +++ b/dashboard/src/containers/OperatorInstanceViewContainer/OperatorInstanceViewContainer.tsx @@ -21,6 +21,7 @@ function mapStateToProps( { match: { params } }: IRouteProps, ) { return { + cluster: currentCluster, namespace: clusters[currentCluster].currentNamespace, csvName: params.csv, crdName: params.crd, diff --git a/dashboard/src/containers/RoutesContainer/Routes.tsx b/dashboard/src/containers/RoutesContainer/Routes.tsx index 498e31033be..3ff45d87595 100644 --- a/dashboard/src/containers/RoutesContainer/Routes.tsx +++ b/dashboard/src/containers/RoutesContainer/Routes.tsx @@ -69,9 +69,9 @@ class Routes extends React.Component { "/c/:cluster/ns/:namespace/operators": OperatorsListContainer, "/c/:cluster/ns/:namespace/operators/:operator": OperatorViewContainer, "/c/:cluster/ns/:namespace/operators/new/:operator": OperatorNewContainer, - "/ns/:namespace/operators-instances/new/:csv/:crd": OperatorInstanceCreateContainer, - "/ns/:namespace/operators-instances/:csv/:crd/:instanceName": OperatorInstanceViewContainer, - "/ns/:namespace/operators-instances/:csv/:crd/:instanceName/update": OperatorInstanceUpdateContainer, + "/c/:cluster/ns/:namespace/operators-instances/new/:csv/:crd": OperatorInstanceCreateContainer, + "/c/:cluster/ns/:namespace/operators-instances/:csv/:crd/:instanceName": OperatorInstanceViewContainer, + "/c/:cluster/ns/:namespace/operators-instances/:csv/:crd/:instanceName/update": OperatorInstanceUpdateContainer, }); } return ( diff --git a/dashboard/src/shared/url.ts b/dashboard/src/shared/url.ts index d9885faafb1..140d41c2c71 100644 --- a/dashboard/src/shared/url.ts +++ b/dashboard/src/shared/url.ts @@ -39,12 +39,23 @@ export const app = { `/c/${cluster}/ns/${namespace}/operators/new/${name}`, }, operatorInstances: { - view: (namespace: string, csvName: string, crdName: string, resourceName: string) => - `/ns/${namespace}/operators-instances/${csvName}/${crdName}/${resourceName}`, - update: (namespace: string, csvName: string, crdName: string, instanceName: string) => - `/ns/${namespace}/operators-instances/${csvName}/${crdName}/${instanceName}/update`, - new: (namespace: string, csvName: string, crdName: string) => - `/ns/${namespace}/operators-instances/new/${csvName}/${crdName}`, + view: ( + cluster: string, + namespace: string, + csvName: string, + crdName: string, + resourceName: string, + ) => `/c/${cluster}/ns/${namespace}/operators-instances/${csvName}/${crdName}/${resourceName}`, + update: ( + cluster: string, + namespace: string, + csvName: string, + crdName: string, + instanceName: string, + ) => + `/c/${cluster}/ns/${namespace}/operators-instances/${csvName}/${crdName}/${instanceName}/update`, + new: (cluster: string, namespace: string, csvName: string, crdName: string) => + `/c/${cluster}/ns/${namespace}/operators-instances/new/${csvName}/${crdName}`, }, config: { apprepositories: (cluster: string, namespace: string) =>