File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/plans/details/tabs/Details/components/DetailsSection/components/PlanWarm/utils Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1+ import { MigrationTypeValue } from 'src/plans/create/steps/migration-type/constants' ;
2+
13import { ADD , REPLACE } from '@components/ModalForm/utils/constants' ;
24import { PlanModel , type V1beta1Plan } from '@kubev2v/types' ;
35import { k8sPatch } from '@openshift-console/dynamic-plugin-sdk' ;
@@ -12,6 +14,7 @@ type OnConfirmWarm = (param: OnConfirmWarmParams) => Promise<V1beta1Plan>;
1214
1315export const onConfirmWarm : OnConfirmWarm = async ( { newValue, resource } ) => {
1416 const op = getPlanIsWarm ( resource ) === undefined ? ADD : REPLACE ;
17+ const type = newValue ? MigrationTypeValue . Warm : MigrationTypeValue . Cold ;
1518
1619 const obj = await k8sPatch ( {
1720 data : [
@@ -20,6 +23,11 @@ export const onConfirmWarm: OnConfirmWarm = async ({ newValue, resource }) => {
2023 path : '/spec/warm' ,
2124 value : newValue ,
2225 } ,
26+ {
27+ op : REPLACE ,
28+ path : '/spec/type' ,
29+ value : type ,
30+ } ,
2331 ] ,
2432 model : PlanModel ,
2533 resource,
You can’t perform that action at this time.
0 commit comments