From 68e3bf57c9f1994b47f0a45b26b5d8e539a062fd Mon Sep 17 00:00:00 2001 From: Jakub Hadvig Date: Thu, 23 May 2019 17:56:33 +0200 Subject: [PATCH] Bug 1713209: Redirect to RC after instantiating DC --- frontend/public/components/deployment-config.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/public/components/deployment-config.tsx b/frontend/public/components/deployment-config.tsx index 9474ee26e23..5fbdbffe9a8 100644 --- a/frontend/public/components/deployment-config.tsx +++ b/frontend/public/components/deployment-config.tsx @@ -16,6 +16,7 @@ import { } from './factory'; import { AsyncComponent, + history, Kebab, KebabAction, ContainerTable, @@ -23,6 +24,7 @@ import { navFactory, pluralize, ResourceSummary, + resourcePath, SectionHeading, togglePaused, WorkloadPausedAlert, @@ -47,9 +49,15 @@ const rollout = (dc: K8sResourceKind): Promise => { return k8sCreate(DeploymentConfigModel, req, opts); }; +const determineReplicationControllerName = (dc: K8sResourceKind): string => { + return `${dc.metadata.name}-${dc.status.latestVersion}`; +}; + const RolloutAction: KebabAction = (kind: K8sKind, obj: K8sResourceKind) => ({ label: 'Start Rollout', - callback: () => rollout(obj).catch(err => { + callback: () => rollout(obj).then(deployment => { + history.push(resourcePath('ReplicationController', determineReplicationControllerName(deployment), deployment.metadata.namespace)); + }).catch(err => { const error = err.message; errorModal({error}); }),