Skip to content

Commit

Permalink
Improve debug logging for Endpoint events
Browse files Browse the repository at this point in the history
Adds EP logging

Signed-off-by: Tim Rozet <trozet@redhat.com>
  • Loading branch information
trozet committed Apr 4, 2020
1 parent 5fee58a commit 0a90c32
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go-controller/pkg/ovn/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (ovn *Controller) getLbEndpoints(ep *kapi.Endpoints) map[kapi.Protocol]map[

// AddEndpoints adds endpoints and creates corresponding resources in OVN
func (ovn *Controller) AddEndpoints(ep *kapi.Endpoints) error {
klog.V(5).Infof("Adding endpoints: %s for namespace: %s", ep.Name, ep.Namespace)
// get service
// TODO: cache the service
svc, err := ovn.watchFactory.GetService(ep.Namespace, ep.Name)
Expand All @@ -58,9 +59,11 @@ func (ovn *Controller) AddEndpoints(ep *kapi.Endpoints) error {
svc.Name, svc.Spec.ClusterIP)
return nil
}
klog.V(5).Infof("Matching service %s found for ep: %s, with cluster IP: %s", svc.Name, ep.Name,
svc.Spec.ClusterIP)

protoPortMap := ovn.getLbEndpoints(ep)

klog.V(5).Infof("Matching service %s ports: %v", svc.Name, svc.Spec.Ports)
for proto, portMap := range protoPortMap {
for svcPortName, lbEps := range portMap {
ips := lbEps.IPs
Expand Down Expand Up @@ -227,6 +230,7 @@ func (ovn *Controller) handleExternalIPs(svc *kapi.Service, svcPort kapi.Service
}

func (ovn *Controller) deleteEndpoints(ep *kapi.Endpoints) error {
klog.V(5).Infof("Deleting endpoints: %s for namespace: %s", ep.Name, ep.Namespace)
svc, err := ovn.watchFactory.GetService(ep.Namespace, ep.Name)
if err != nil {
// This is not necessarily an error. For e.g when a service is deleted,
Expand Down

0 comments on commit 0a90c32

Please sign in to comment.