Skip to content

Commit

Permalink
debug logging in bpf proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaaaaaalex committed Jun 14, 2024
1 parent 35fb465 commit bce1e0c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions felix/bpf/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,12 @@ func (p *proxy) invokeDPSyncer() {
}

func (p *proxy) OnServiceAdd(svc *v1.Service) {
log.WithField("svc", svc).Debug("Add service")
p.OnServiceUpdate(nil, svc)
}

func (p *proxy) OnServiceUpdate(old, curr *v1.Service) {
log.WithFields(log.Fields{"old": old, "curr": curr}).Debug("Update service")
if p.svcChanges.Update(old, curr) && p.isInitialized() {
p.syncDP()
}
Expand All @@ -298,29 +300,35 @@ func (p *proxy) OnServiceDelete(svc *v1.Service) {
}

func (p *proxy) OnServiceSynced() {
log.Debug("Services cache synced. Forcing dataplane sync...")
p.setSvcsSynced()
p.forceSyncDP()
}

func (p *proxy) OnEndpointSliceAdd(eps *discovery.EndpointSlice) {
log.WithField("eps", eps).Debug("EndpointSlice add")
if p.epsChanges.EndpointSliceUpdate(eps, false) && p.isInitialized() {
p.syncDP()
}
}

func (p *proxy) OnEndpointSliceUpdate(_, eps *discovery.EndpointSlice) {
log.WithField("eps", eps).Debug("EndpointSlice update")
if p.epsChanges.EndpointSliceUpdate(eps, false) && p.isInitialized() {
p.syncDP()
}
}

func (p *proxy) OnEndpointSliceDelete(eps *discovery.EndpointSlice) {
log.WithField("eps", eps).Debug("EndpointSlice delete")
if p.epsChanges.EndpointSliceUpdate(eps, true) && p.isInitialized() {
p.syncDP()
}
}

func (p *proxy) OnEndpointSlicesSynced() {
log.Debug("EndpointSlices synced")

p.setEpsSynced()
p.forceSyncDP()
}
Expand Down

0 comments on commit bce1e0c

Please sign in to comment.