File tree Expand file tree Collapse file tree 3 files changed +7
-25
lines changed
dr-status-popover/parsers
modals/app-manage-policies Expand file tree Collapse file tree 3 files changed +7
-25
lines changed Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
- import {
3
- DISCOVERED_APP_NS ,
4
- KUBE_INSTANCE_LABEL ,
5
- ODF_RESOURCE_TYPE_LABEL ,
6
- } from '@odf/mco/constants' ;
2
+ import { DISCOVERED_APP_NS , KUBE_INSTANCE_LABEL } from '@odf/mco/constants' ;
7
3
import {
8
4
getApplicationResourceObj ,
9
5
getApplicationSetResourceObj ,
@@ -27,7 +23,6 @@ import {
27
23
getLabel ,
28
24
getName ,
29
25
getNamespace ,
30
- VirtualMachineModel ,
31
26
} from '@odf/shared' ;
32
27
import {
33
28
K8sResourceCommon ,
@@ -75,12 +70,6 @@ const DiscoveredHelper: React.FC<ParserHelperProps> = ({
75
70
> (
76
71
getDRPlacementControlResourceObj ( {
77
72
namespace : DISCOVERED_APP_NS ,
78
- selector : {
79
- matchLabels : {
80
- // To optimize the VM DRPC watch
81
- [ ODF_RESOURCE_TYPE_LABEL ] : VirtualMachineModel . kind . toLowerCase ( ) ,
82
- } ,
83
- } ,
84
73
} )
85
74
) ;
86
75
Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
2
import { getPlacementKindObj } from '@odf/mco/components/discovered-application-wizard/utils/k8s-utils' ;
3
- import {
4
- DISCOVERED_APP_NS ,
5
- DRApplication ,
6
- ODF_RESOURCE_TYPE_LABEL ,
7
- } from '@odf/mco/constants' ;
3
+ import { DISCOVERED_APP_NS , DRApplication } from '@odf/mco/constants' ;
8
4
import {
9
5
getDRPlacementControlResourceObj ,
10
6
getDRPolicyResourceObj ,
@@ -16,7 +12,7 @@ import {
16
12
getSearchResultItems ,
17
13
queryAppWorkloadPVCs ,
18
14
} from '@odf/mco/utils' ;
19
- import { getName , getNamespace , VirtualMachineModel } from '@odf/shared' ;
15
+ import { getName , getNamespace } from '@odf/shared' ;
20
16
import {
21
17
K8sResourceCommon ,
22
18
useK8sWatchResource ,
@@ -53,12 +49,6 @@ export const DiscoveredVMParser: React.FC<DiscoveredVMParserProps> = ({
53
49
> (
54
50
getDRPlacementControlResourceObj ( {
55
51
namespace : DISCOVERED_APP_NS ,
56
- selector : {
57
- matchLabels : {
58
- // To optimize the VM DRPC watch
59
- [ ODF_RESOURCE_TYPE_LABEL ] : VirtualMachineModel . kind . toLowerCase ( ) ,
60
- } ,
61
- } ,
62
52
} )
63
53
) ;
64
54
Original file line number Diff line number Diff line change @@ -180,7 +180,10 @@ export const findDRPCUsingVM = (
180
180
) : DRPlacementControlKind | undefined =>
181
181
drpcs . find (
182
182
( drpc ) =>
183
- getVMNamesFromRecipe ( drpc . spec ) . includes ( vmName ) &&
183
+ ( getVMNamesFromRecipe ( drpc . spec ) . includes ( vmName ) ||
184
+ (
185
+ drpc . status ?. resourceConditions ?. resourceMeta ?. protectedpvcs || [ ]
186
+ ) . some ( ( pvc ) => pvc . startsWith ( vmName ) ) ) &&
184
187
drpc . spec ?. protectedNamespaces ?. includes ( vmNamespace ) &&
185
188
getPrimaryClusterName ( drpc ) === cluster
186
189
) ;
You can’t perform that action at this time.
0 commit comments