endpointslice controller: set new conditions 'accepting' and 'terminating'
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
This commit is contained in:
@@ -122,14 +122,14 @@ func DeepHashObjectToString(objectToWrite interface{}) string {
|
||||
return hex.EncodeToString(hasher.Sum(nil)[0:])
|
||||
}
|
||||
|
||||
// ShouldPodBeInEndpoints returns true if a specified pod should be in an
|
||||
// endpoints object. Terminating pods are only included if publishNotReady is true.
|
||||
func ShouldPodBeInEndpoints(pod *v1.Pod, publishNotReady bool) bool {
|
||||
// ShouldPodBeInEndpointSlice returns true if a specified pod should be in an EndpointSlice object.
|
||||
// Terminating pods are only included if includeTerminating is true
|
||||
func ShouldPodBeInEndpointSlice(pod *v1.Pod, includeTerminating bool) bool {
|
||||
if len(pod.Status.PodIP) == 0 && len(pod.Status.PodIPs) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
if !publishNotReady && pod.DeletionTimestamp != nil {
|
||||
if !includeTerminating && pod.DeletionTimestamp != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user