mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
metaproxier logging for endpoints ipfamily
The kube-proxy metaproxier implementations tries to get the IPFamily from the endpoints, but if the endpoints doesn't contains an IP address it logs a Warning. This causes that services without endpoints keep flooding the logs with warnings. We log this errors with a level of Verbosity of 4 instead of a Warning
This commit is contained in:
parent
23d9ffd4c8
commit
df58c042a8
@ -1,6 +1,6 @@
|
|||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
@ -28,3 +28,10 @@ filegroup(
|
|||||||
srcs = [":package-srcs"],
|
srcs = [":package-srcs"],
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
go_test(
|
||||||
|
name = "go_default_test",
|
||||||
|
srcs = ["meta_proxier_test.go"],
|
||||||
|
embed = [":go_default_library"],
|
||||||
|
deps = ["//staging/src/k8s.io/api/core/v1:go_default_library"],
|
||||||
|
)
|
||||||
|
@ -103,7 +103,7 @@ func (proxier *metaProxier) OnServiceSynced() {
|
|||||||
func (proxier *metaProxier) OnEndpointsAdd(endpoints *v1.Endpoints) {
|
func (proxier *metaProxier) OnEndpointsAdd(endpoints *v1.Endpoints) {
|
||||||
ipFamily, err := endpointsIPFamily(endpoints)
|
ipFamily, err := endpointsIPFamily(endpoints)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Warningf("failed to add endpoints %s/%s with error %v", endpoints.ObjectMeta.Namespace, endpoints.ObjectMeta.Name, err)
|
klog.V(4).Infof("failed to add endpoints %s/%s with error %v", endpoints.ObjectMeta.Namespace, endpoints.ObjectMeta.Name, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if *ipFamily == v1.IPv4Protocol {
|
if *ipFamily == v1.IPv4Protocol {
|
||||||
@ -118,7 +118,7 @@ func (proxier *metaProxier) OnEndpointsAdd(endpoints *v1.Endpoints) {
|
|||||||
func (proxier *metaProxier) OnEndpointsUpdate(oldEndpoints, endpoints *v1.Endpoints) {
|
func (proxier *metaProxier) OnEndpointsUpdate(oldEndpoints, endpoints *v1.Endpoints) {
|
||||||
ipFamily, err := endpointsIPFamily(endpoints)
|
ipFamily, err := endpointsIPFamily(endpoints)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Warningf("failed to update endpoints %s/%s with error %v", endpoints.ObjectMeta.Namespace, endpoints.ObjectMeta.Name, err)
|
klog.V(4).Infof("failed to update endpoints %s/%s with error %v", endpoints.ObjectMeta.Namespace, endpoints.ObjectMeta.Name, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ func (proxier *metaProxier) OnEndpointsUpdate(oldEndpoints, endpoints *v1.Endpoi
|
|||||||
func (proxier *metaProxier) OnEndpointsDelete(endpoints *v1.Endpoints) {
|
func (proxier *metaProxier) OnEndpointsDelete(endpoints *v1.Endpoints) {
|
||||||
ipFamily, err := endpointsIPFamily(endpoints)
|
ipFamily, err := endpointsIPFamily(endpoints)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Warningf("failed to delete endpoints %s/%s with error %v", endpoints.ObjectMeta.Namespace, endpoints.ObjectMeta.Name, err)
|
klog.V(4).Infof("failed to delete endpoints %s/%s with error %v", endpoints.ObjectMeta.Namespace, endpoints.ObjectMeta.Name, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user