Updating apiserver Endpoints management to set skip-mirror label
This will ensure that the self-referential kubernetes Endpoints resources is not mirrored by the EndpointSliceMirroring controller.
This commit is contained in:
@@ -76,6 +76,11 @@ func (r *masterCountEndpointReconciler) ReconcileEndpoints(serviceName string, i
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Don't use the EndpointSliceMirroring controller to mirror this to
|
||||
// EndpointSlices. This may change in the future.
|
||||
skipMirrorChanged := setSkipMirrorTrue(e)
|
||||
|
||||
if errors.IsNotFound(err) {
|
||||
// Simply create non-existing endpoints for the service.
|
||||
e.Subsets = []corev1.EndpointSubset{{
|
||||
@@ -99,7 +104,8 @@ func (r *masterCountEndpointReconciler) ReconcileEndpoints(serviceName string, i
|
||||
_, err = r.epAdapter.Update(metav1.NamespaceDefault, e)
|
||||
return err
|
||||
}
|
||||
if ipCorrect && portsCorrect {
|
||||
|
||||
if !skipMirrorChanged && ipCorrect && portsCorrect {
|
||||
return r.epAdapter.EnsureEndpointSliceFromEndpoints(metav1.NamespaceDefault, e)
|
||||
}
|
||||
if !ipCorrect {
|
||||
|
||||
Reference in New Issue
Block a user