mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Merge pull request #3729 from smarterclayton/print_less_output
Endpoints controller can print sensitive pod info when errors occur
This commit is contained in:
commit
bb9a37dc84
@ -56,10 +56,10 @@ func (e *EndpointController) SyncServiceEndpoints() error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.V(3).Infof("About to update endpoints for service %v", service.Name)
|
glog.V(5).Infof("About to update endpoints for service %s/%s", service.Namespace, service.Name)
|
||||||
pods, err := e.client.Pods(service.Namespace).List(labels.Set(service.Spec.Selector).AsSelector())
|
pods, err := e.client.Pods(service.Namespace).List(labels.Set(service.Spec.Selector).AsSelector())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Error syncing service: %#v, skipping.", service)
|
glog.Errorf("Error syncing service: %s/%s, skipping", service.Namespace, service.Name)
|
||||||
resultErr = err
|
resultErr = err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -68,11 +68,11 @@ func (e *EndpointController) SyncServiceEndpoints() error {
|
|||||||
for _, pod := range pods.Items {
|
for _, pod := range pods.Items {
|
||||||
port, err := findPort(&pod, service.Spec.ContainerPort)
|
port, err := findPort(&pod, service.Spec.ContainerPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Failed to find port for service: %v, %v", service, err)
|
glog.Errorf("Failed to find port for service %s/%s: %v", service.Namespace, service.Name, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if len(pod.Status.PodIP) == 0 {
|
if len(pod.Status.PodIP) == 0 {
|
||||||
glog.Errorf("Failed to find an IP for pod: %v", pod)
|
glog.Errorf("Failed to find an IP for pod %s/%s", pod.Namespace, pod.Name)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
endpoints = append(endpoints, net.JoinHostPort(pod.Status.PodIP, strconv.Itoa(port)))
|
endpoints = append(endpoints, net.JoinHostPort(pod.Status.PodIP, strconv.Itoa(port)))
|
||||||
@ -100,7 +100,7 @@ func (e *EndpointController) SyncServiceEndpoints() error {
|
|||||||
} else {
|
} else {
|
||||||
// Pre-existing
|
// Pre-existing
|
||||||
if endpointsEqual(currentEndpoints, endpoints) {
|
if endpointsEqual(currentEndpoints, endpoints) {
|
||||||
glog.V(3).Infof("endpoints are equal for %s, skipping update", service.Name)
|
glog.V(5).Infof("endpoints are equal for %s/%s, skipping update", service.Namespace, service.Name)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
_, err = e.client.Endpoints(service.Namespace).Update(newEndpoints)
|
_, err = e.client.Endpoints(service.Namespace).Update(newEndpoints)
|
||||||
|
Loading…
Reference in New Issue
Block a user