Skip to content

Commit 614d055

Browse files
author
Zhiying Lin
committed
address comments
1 parent b513116 commit 614d055

File tree

7 files changed

+14
-7
lines changed

7 files changed

+14
-7
lines changed

pkg/controllers/member/endpointslice/controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
113113
return ctrl.Result{}, nil
114114
}
115115

116+
// When the member leaves, the controller will continue to unexport the endpointSlice as intended.
116117
if !r.joined.Load() {
117-
klog.V(2).InfoS("EndpointSlice controller is not started yet, requeue the request", "endpointSlice", endpointSliceRef)
118+
klog.V(2).InfoS("EndpointSlice controller has not joined yet, skip exporting the endpointSlice and requeue the request", "endpointSlice", endpointSliceRef)
118119
return ctrl.Result{RequeueAfter: time.Second * 5}, nil
119120
}
120121

pkg/controllers/member/endpointsliceimport/controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
133133
return ctrl.Result{}, nil
134134
}
135135

136+
// When the member leaves, the controller will continue to handle the deleted endpointSliceImport as intended.
136137
if !r.joined.Load() {
137-
klog.V(2).InfoS("EndpointSliceImport controller is not started yet, requeue the request", "endpointSliceImport", endpointSliceImportRef)
138+
klog.V(2).InfoS("EndpointSliceImport controller has not joined yet, skip importing the endpointSlice and requeue the request", "endpointSliceImport", endpointSliceImportRef)
138139
return ctrl.Result{RequeueAfter: time.Second * 5}, nil
139140
}
140141

pkg/controllers/member/internalserviceexport/controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
133133
return ctrl.Result{}, err
134134
}
135135

136+
// When the member leaves, the controller will continue to handle deleted ServiceExport as intended.
136137
if !r.joined.Load() {
137-
klog.V(2).InfoS("InternalServiceExport controller is not started yet, requeue the request", "internalServiceExport", internalSvcExportRef)
138+
klog.V(2).InfoS("InternalServiceExport controller has not joined yet, skip validating serviceExport and requeue the request", "internalServiceExport", internalSvcExportRef)
138139
return ctrl.Result{RequeueAfter: time.Second * 5}, nil
139140
}
140141

pkg/controllers/member/internalserviceimport/controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
8181
return ctrl.Result{}, err
8282
}
8383

84+
// When the member leaves, the controller will continue to handle the deleted serviceImport as intended.
8485
if !r.joined.Load() {
85-
klog.V(2).InfoS("InternalServiceImport controller is not started yet, requeue the request", "internalServiceImport", internalSvcImportKRef)
86+
klog.V(2).InfoS("InternalServiceImport controller has not joined yet, skip updating serviceImport status and requeue the request", "internalServiceImport", internalSvcImportKRef)
8687
return ctrl.Result{RequeueAfter: time.Second * 5}, nil
8788
}
8889

pkg/controllers/member/serviceexport/controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
106106
return ctrl.Result{}, nil
107107
}
108108

109+
// When the member leaves, the controller will continue to handle the deleted serviceExport as intended.
109110
if !r.joined.Load() {
110-
klog.V(2).InfoS("ServiceExport controller is not started yet, requeue the request", "service", svcRef)
111+
klog.V(2).InfoS("ServiceExport controller has not joined yet, skip handling serviceExport and requeue the request", "service", svcRef)
111112
return ctrl.Result{RequeueAfter: time.Second * 5}, nil
112113
}
113114

pkg/controllers/member/serviceimport/controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
9999
return ctrl.Result{}, nil
100100
}
101101

102+
// When the member leaves, the controller will continue to handle the deleted serviceImport as intended.
102103
if !r.joined.Load() {
103-
klog.V(2).InfoS("ServiceImport controller is not started yet, requeue the request", "serviceImport", serviceImportRef)
104+
klog.V(2).InfoS("ServiceImport controller has not joined yet, skip handling serviceImport and requeue the request", "serviceImport", serviceImportRef)
104105
return ctrl.Result{RequeueAfter: time.Second * 5}, nil
105106
}
106107

pkg/controllers/multiclusterservice/controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
100100
return r.handleDelete(ctx, &mcs)
101101
}
102102

103+
// When the member leaves, the controller will continue to handle the deleted multiClusterService as intended.
103104
if !r.joined.Load() {
104-
klog.V(2).InfoS("MultiClusterService controller is not started yet, requeue the request", "multiClusterService", mcsKRef)
105+
klog.V(2).InfoS("MultiClusterService controller has not joined yet, skip handling the multiClusterService and requeue the request", "multiClusterService", mcsKRef)
105106
return ctrl.Result{RequeueAfter: time.Second * 5}, nil
106107
}
107108

0 commit comments

Comments
 (0)