@@ -104,14 +104,23 @@ func (l *LeafPVCController) Reconcile(ctx context.Context, request reconcile.Req
104
104
klog .Errorf ("patch pvc error: %v" , err )
105
105
return reconcile.Result {}, err
106
106
}
107
- _ , err = l .RootClientSet .CoreV1 ().PersistentVolumeClaims (rootPVC .Namespace ).Patch (ctx ,
107
+ updatedRootPvc , err : = l .RootClientSet .CoreV1 ().PersistentVolumeClaims (rootPVC .Namespace ).Patch (ctx ,
108
108
rootPVC .Name , mergetypes .MergePatchType , patch , metav1.PatchOptions {})
109
109
if err != nil {
110
110
klog .Errorf ("patch pvc namespace: %q, name: %q to root cluster failed, error: %v" ,
111
111
request .NamespacedName .Namespace , request .NamespacedName .Name , err )
112
112
return reconcile.Result {RequeueAfter : utils .DefaultRequeueTime }, nil
113
113
}
114
114
115
+ updatedRootPvc .Status = pvcCopy .Status
116
+ updatedRootPvc .ResourceVersion = "0"
117
+ err = l .RootClient .Status ().Update (ctx , updatedRootPvc )
118
+ if err != nil {
119
+ klog .Errorf ("update pvc status namespace: %q, name: %q to root cluster failed, error: %v" ,
120
+ request .NamespacedName .Namespace , request .NamespacedName .Name , err )
121
+ return reconcile.Result {RequeueAfter : utils .DefaultRequeueTime }, nil
122
+ }
123
+
115
124
return reconcile.Result {}, nil
116
125
}
117
126
0 commit comments