Merge pull request #74004 from mm4tt/kube-proxy-log

Don't log warning when EndpointsLastChangeTriggerTime not set.
pull/564/head
Kubernetes Prow Robot 2019-02-13 03:05:39 -08:00 committed by GitHub
commit 5c660f83b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -161,6 +161,11 @@ func (ect *EndpointChangeTracker) Update(previous, current *v1.Endpoints) bool {
// annotation stored in the given endpoints object or the "zero" time if the annotation wasn't set
// or was set incorrectly.
func getLastChangeTriggerTime(endpoints *v1.Endpoints) time.Time {
if _, ok := endpoints.Annotations[v1.EndpointsLastChangeTriggerTime]; !ok {
// It's possible that the Endpoints object won't have the EndpointsLastChangeTriggerTime
// annotation set. In that case return the 'zero value', which is ignored in the upstream code.
return time.Time{}
}
val, err := time.Parse(time.RFC3339Nano, endpoints.Annotations[v1.EndpointsLastChangeTriggerTime])
if err != nil {
klog.Warningf("Error while parsing EndpointsLastChangeTriggerTimeAnnotation: '%s'. Error is %v",