Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhiying Lin committed Aug 7, 2024
1 parent b513116 commit 614d055
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion pkg/controllers/member/endpointslice/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
return ctrl.Result{}, nil
}

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

Expand Down
3 changes: 2 additions & 1 deletion pkg/controllers/member/endpointsliceimport/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
return ctrl.Result{}, nil
}

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

Expand Down
3 changes: 2 additions & 1 deletion pkg/controllers/member/internalserviceexport/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
return ctrl.Result{}, err
}

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

Expand Down
3 changes: 2 additions & 1 deletion pkg/controllers/member/internalserviceimport/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
return ctrl.Result{}, err
}

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

Expand Down
3 changes: 2 additions & 1 deletion pkg/controllers/member/serviceexport/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
return ctrl.Result{}, nil
}

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

Expand Down
3 changes: 2 additions & 1 deletion pkg/controllers/member/serviceimport/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
return ctrl.Result{}, nil
}

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

Expand Down
3 changes: 2 additions & 1 deletion pkg/controllers/multiclusterservice/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
return r.handleDelete(ctx, &mcs)
}

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

Expand Down

0 comments on commit 614d055

Please sign in to comment.