@@ -101,26 +101,26 @@ func (c *EndpointsliceDispatchController) Reconcile(ctx context.Context, req con
101
101
var err error
102
102
defer func () {
103
103
if err != nil {
104
- _ = c .updateEndpointSliceSynced (mcs , metav1 .ConditionFalse , "EndpointSliceSyncFailed " , err .Error ())
104
+ _ = c .updateEndpointSliceDispatched (mcs , metav1 .ConditionFalse , "EndpointSliceDispatchedFailed " , err .Error ())
105
105
c .EventRecorder .Eventf (mcs , corev1 .EventTypeWarning , events .EventReasonDispatchEndpointSliceFailed , err .Error ())
106
106
return
107
107
}
108
- _ = c .updateEndpointSliceSynced (mcs , metav1 .ConditionTrue , "EndpointSliceSyncSucceed " , "EndpointSlice are synced successfully" )
109
- c .EventRecorder .Eventf (mcs , corev1 .EventTypeNormal , events .EventReasonDispatchEndpointSliceSucceed , "EndpointSlice are synced successfully" )
108
+ _ = c .updateEndpointSliceDispatched (mcs , metav1 .ConditionTrue , "EndpointSliceDispatchedSucceed " , "EndpointSlice are dispatched successfully" )
109
+ c .EventRecorder .Eventf (mcs , corev1 .EventTypeNormal , events .EventReasonDispatchEndpointSliceSucceed , "EndpointSlice are dispatched successfully" )
110
110
}()
111
111
112
112
if err = c .cleanOrphanDispatchedEndpointSlice (ctx , mcs ); err != nil {
113
113
return controllerruntime.Result {Requeue : true }, err
114
114
}
115
115
116
- if err = c .syncEndpointSlice (ctx , work .DeepCopy (), mcs ); err != nil {
116
+ if err = c .dispatchEndpointSlice (ctx , work .DeepCopy (), mcs ); err != nil {
117
117
return controllerruntime.Result {Requeue : true }, err
118
118
}
119
119
120
120
return controllerruntime.Result {}, nil
121
121
}
122
122
123
- func (c * EndpointsliceDispatchController ) updateEndpointSliceSynced (mcs * networkingv1alpha1.MultiClusterService , status metav1.ConditionStatus , reason , message string ) error {
123
+ func (c * EndpointsliceDispatchController ) updateEndpointSliceDispatched (mcs * networkingv1alpha1.MultiClusterService , status metav1.ConditionStatus , reason , message string ) error {
124
124
EndpointSliceCollected := metav1.Condition {
125
125
Type : networkingv1alpha1 .EndpointSliceDispatched ,
126
126
Status : status ,
@@ -249,7 +249,7 @@ func (c *EndpointsliceDispatchController) cleanOrphanDispatchedEndpointSlice(ctx
249
249
return nil
250
250
}
251
251
252
- func (c * EndpointsliceDispatchController ) syncEndpointSlice (ctx context.Context , work * workv1alpha1.Work , mcs * networkingv1alpha1.MultiClusterService ) error {
252
+ func (c * EndpointsliceDispatchController ) dispatchEndpointSlice (ctx context.Context , work * workv1alpha1.Work , mcs * networkingv1alpha1.MultiClusterService ) error {
253
253
epsSourceCluster , err := names .GetClusterName (work .Namespace )
254
254
if err != nil {
255
255
klog .Errorf ("Failed to get EndpointSlice source cluster name for work %s/%s" , work .Namespace , work .Name )
@@ -322,7 +322,7 @@ func (c *EndpointsliceDispatchController) syncEndpointSlice(ctx context.Context,
322
322
return err
323
323
}
324
324
if err := helper .CreateOrUpdateWork (c .Client , workMeta , unstructuredEPS ); err != nil {
325
- klog .Errorf ("Failed to sync EndpointSlice %s/%s from %s to cluster %s:%v" ,
325
+ klog .Errorf ("Failed to dispatch EndpointSlice %s/%s from %s to cluster %s:%v" ,
326
326
work .GetNamespace (), work .GetName (), epsSourceCluster , clusterName , err )
327
327
return err
328
328
}
0 commit comments