@@ -2469,7 +2469,8 @@ func ensureVRGsManagedByDRPC(
2469
2469
2470
2470
for cluster , viewVRG := range vrgs {
2471
2471
if ! viewVRG .GetDeletionTimestamp ().IsZero () {
2472
- log .Info ("VRG reported by view undergoing deletion, during adoption" )
2472
+ log .Info ("VRG reported by view undergoing deletion, during adoption" ,
2473
+ "cluster" , cluster , "namespace" , viewVRG .Namespace , "name" , viewVRG .Name )
2473
2474
2474
2475
continue
2475
2476
}
@@ -2503,7 +2504,7 @@ func adoptVRG(
2503
2504
mw , err := mwu .FindManifestWorkByType (rmnutil .MWTypeVRG , cluster )
2504
2505
if err != nil {
2505
2506
if ! errors .IsNotFound (err ) {
2506
- log .Info ("error fetching VRG ManifestWork during adoption" , "error" , err )
2507
+ log .Info ("error fetching VRG ManifestWork during adoption" , "error" , err , "cluster" , cluster )
2507
2508
2508
2509
return ! adopted
2509
2510
}
@@ -2514,14 +2515,14 @@ func adoptVRG(
2514
2515
}
2515
2516
2516
2517
if ! mw .GetDeletionTimestamp ().IsZero () {
2517
- log .Info ("VRG ManifestWork found deleted during adoption" )
2518
+ log .Info ("VRG ManifestWork found deleted during adoption" , "cluster" , cluster )
2518
2519
2519
2520
return adopted
2520
2521
}
2521
2522
2522
2523
vrg , err := rmnutil .ExtractVRGFromManifestWork (mw )
2523
2524
if err != nil {
2524
- log .Info ("error extracting VRG from ManifestWork during adoption" , "error" , err )
2525
+ log .Info ("error extracting VRG from ManifestWork during adoption" , "error" , err , "cluster" , cluster )
2525
2526
2526
2527
return ! adopted
2527
2528
}
@@ -2541,12 +2542,17 @@ func adoptExistingVRGManifestWork(
2541
2542
drpc * rmn.DRPlacementControl ,
2542
2543
vrgNamespace string ,
2543
2544
) {
2545
+ log .Info ("adopting existing VRG ManifestWork" , "cluster" , cluster , "namespace" , vrg .Namespace , "name" , vrg .Name )
2546
+
2544
2547
if vrg .GetAnnotations () == nil {
2545
2548
vrg .Annotations = make (map [string ]string )
2546
2549
}
2547
2550
2548
2551
if v , ok := vrg .Annotations [DRPCUIDAnnotation ]; ok && v == string (drpc .UID ) {
2549
2552
// Annotation may already be set but not reflected on the resource view yet
2553
+ log .Info ("detected VRGs DRPC UID annotation as existing" ,
2554
+ "cluster" , cluster , "namespace" , vrg .Namespace , "name" , vrg .Name )
2555
+
2550
2556
return
2551
2557
}
2552
2558
@@ -2558,7 +2564,7 @@ func adoptExistingVRGManifestWork(
2558
2564
2559
2565
err := mwu .CreateOrUpdateVRGManifestWork (drpc .Name , vrgNamespace , cluster , * vrg , annotations )
2560
2566
if err != nil {
2561
- log .Info ("error updating VRG via ManifestWork during adoption" , "error" , err )
2567
+ log .Info ("error updating VRG via ManifestWork during adoption" , "error" , err , "cluster" , cluster )
2562
2568
}
2563
2569
}
2564
2570
@@ -2571,14 +2577,17 @@ func adoptOrphanVRG(
2571
2577
drpc * rmn.DRPlacementControl ,
2572
2578
vrgNamespace string ,
2573
2579
) {
2580
+ log .Info ("adopting orphaned VRG ManifestWork" ,
2581
+ "cluster" , cluster , "namespace" , viewVRG .Namespace , "name" , viewVRG .Name )
2582
+
2574
2583
annotations := make (map [string ]string )
2575
2584
annotations [DRPCNameAnnotation ] = drpc .Name
2576
2585
annotations [DRPCNamespaceAnnotation ] = drpc .Namespace
2577
2586
2578
2587
// Adopt the namespace as well
2579
2588
err := mwu .CreateOrUpdateNamespaceManifest (drpc .Name , vrgNamespace , cluster , annotations )
2580
2589
if err != nil {
2581
- log .Info ("error creating namespace via ManifestWork during adoption" , "error" , err )
2590
+ log .Info ("error creating namespace via ManifestWork during adoption" , "error" , err , "cluster" , cluster )
2582
2591
2583
2592
return
2584
2593
}
@@ -2593,7 +2602,7 @@ func adoptOrphanVRG(
2593
2602
if err := mwu .CreateOrUpdateVRGManifestWork (
2594
2603
drpc .Name , vrgNamespace ,
2595
2604
cluster , * vrg , annotations ); err != nil {
2596
- log .Info ("error creating VRG via ManifestWork during adoption" , "error" , err )
2605
+ log .Info ("error creating VRG via ManifestWork during adoption" , "error" , err , "cluster" , cluster )
2597
2606
}
2598
2607
}
2599
2608
0 commit comments