@@ -23,7 +23,7 @@ import (
23
23
)
24
24
25
25
func New (ctx * synccontext.RegisterContext ) (syncertypes.Object , error ) {
26
- mapper , err := ctx .Mappings .ByGVK (mappings .Endpoints ())
26
+ mapper , err := ctx .Mappings .ByGVK (mappings .EndpointSlices ())
27
27
if err != nil {
28
28
return nil , err
29
29
}
@@ -63,7 +63,7 @@ func (s *endpointSliceSyncer) SyncToHost(ctx *synccontext.SyncContext, event *sy
63
63
}
64
64
65
65
pObj := s .translate (ctx , event .Virtual )
66
- err := pro .ApplyPatchesHostObject (ctx , nil , pObj , event .Virtual , ctx .Config .Sync .ToHost .EndpointSlices .Patches , false )
66
+ err := pro .ApplyPatchesHostObject (ctx , pObj , event .Virtual , ctx .Config .Sync .ToHost .EndpointSlices .Patches , false )
67
67
if err != nil {
68
68
return ctrl.Result {}, err
69
69
}
@@ -129,7 +129,7 @@ func (s *endpointSliceSyncer) ReconcileStart(ctx *synccontext.SyncContext, req c
129
129
} else if svc .Spec .Selector != nil {
130
130
// check if it was a managed endpointSlice object before and delete it
131
131
endpointSlice := & discoveryv1.EndpointSlice {}
132
- err = ctx .PhysicalClient .Get (ctx , s .VirtualToHost (ctx , req .NamespacedName , nil ), endpointSlice )
132
+ err = ctx .HostClient .Get (ctx , s .VirtualToHost (ctx , req .NamespacedName , nil ), endpointSlice )
133
133
if err != nil {
134
134
if ! kerrors .IsNotFound (err ) {
135
135
klog .Infof ("Error retrieving endpointSliceList: %v" , err )
@@ -146,7 +146,7 @@ func (s *endpointSliceSyncer) ReconcileStart(ctx *synccontext.SyncContext, req c
146
146
// to the same endpoints resulting in wrong DNS and cluster networking. Hence, deleting the previously
147
147
// managed endpointSlices signals the Kubernetes controller to recreate the endpointSlices from the selector.
148
148
klog .Infof ("Refresh endpointSlice in physical cluster because they shouldn't be managed by vcluster anymore" )
149
- err = ctx .PhysicalClient .Delete (ctx , endpointSlice )
149
+ err = ctx .HostClient .Delete (ctx , endpointSlice )
150
150
if err != nil {
151
151
klog .Infof ("Error deleting endpoints %s/%s: %v" , endpointSlice .Namespace , endpointSlice .Name , err )
152
152
return true , err
@@ -158,10 +158,10 @@ func (s *endpointSliceSyncer) ReconcileStart(ctx *synccontext.SyncContext, req c
158
158
159
159
// check if it was a Kubernetes managed endpointSlice object before and delete it
160
160
endpointSlice := & discoveryv1.EndpointSlice {}
161
- err = ctx .PhysicalClient .Get (ctx , s .VirtualToHost (ctx , req .NamespacedName , nil ), endpointSlice )
161
+ err = ctx .HostClient .Get (ctx , s .VirtualToHost (ctx , req .NamespacedName , nil ), endpointSlice )
162
162
if err == nil && (endpointSlice .Annotations == nil || endpointSlice .Annotations [translate .NameAnnotation ] == "" ) {
163
163
klog .Infof ("Refresh endpointSlice in physical cluster because they should be managed by vCluster now" )
164
- err = ctx .PhysicalClient .Delete (ctx , endpointSlice )
164
+ err = ctx .HostClient .Delete (ctx , endpointSlice )
165
165
if err != nil {
166
166
klog .Infof ("Error deleting endpointSlice %s/%s: %v" , endpointSlice .Namespace , endpointSlice .Name , err )
167
167
return true , err
0 commit comments