kube-proxy: log service and endpoint updates

This commit is contained in:
Tim Hockin
2020-04-09 13:56:34 -07:00
parent 37da906db2
commit 341022f8d1
4 changed files with 29 additions and 16 deletions

View File

@@ -49,7 +49,14 @@ type ServicePortName struct {
}
func (spn ServicePortName) String() string {
return fmt.Sprintf("%s:%s", spn.NamespacedName.String(), spn.Port)
return fmt.Sprintf("%s%s", spn.NamespacedName.String(), fmtPortName(spn.Port))
}
func fmtPortName(in string) string {
if in == "" {
return ""
}
return fmt.Sprintf(":%s", in)
}
// ServicePort is an interface which abstracts information about a service.