mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-21 01:50:55 +00:00
endpoints: If namespace is terminating, drop item immediately
Avoid sending an event to the namespace that is being terminated, since it will be rejected.
This commit is contained in:
@@ -506,6 +506,11 @@ func (e *EndpointController) syncService(key string) error {
|
||||
// 2. policy is misconfigured, in which case no service would function anywhere.
|
||||
// Given the frequency of 1, we log at a lower level.
|
||||
klog.V(5).Infof("Forbidden from creating endpoints: %v", err)
|
||||
|
||||
// If the namespace is terminating, creates will continue to fail. Simply drop the item.
|
||||
if errors.HasStatusCause(err, v1.NamespaceTerminatingCause) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
if createEndpoints {
|
||||
|
Reference in New Issue
Block a user