Skip to content

Commit

Permalink
daemon: Init endpoint queue during validation
Browse files Browse the repository at this point in the history
This commit fixes the following errors:

```
evel=error msg="Unable to enqueue endpoint policy visibility event"
containerID=9f680a5847 datapathPolicyRevision=0 desiredPolicyRevision=0
endpointID=3479 error="unable to Enqueue event" identity=8771
ipv4=10.116.2.10 ipv6=
k8sPodName=cilium-monitoring/grafana-6d49bd9ff7-s8zsd subsys=endpoint
```

These errors occurred because during endpoint validation (when the
endpoint is being restored), its event queue has not been initialized
yet. Once the endpoint is eventually exposed endpoint manager (after
restoration), it will begin processing the events off the queue.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
  • Loading branch information
christarazi authored and tklauser committed Oct 19, 2020
1 parent 79bf425 commit 290d9e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions daemon/cmd/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ func (d *Daemon) validateEndpoint(ep *endpoint.Endpoint) (valid bool, err error)
return false, fmt.Errorf("Kubernetes pod %s/%s does not exist", ep.K8sNamespace, ep.K8sPodName)
}

// Initialize the endpoint's event queue because the following call to
// execute the metadata resolver will emit events for the endpoint.
// After this endpoint is validated, it'll eventually be restored, in
// which the endpoint manager will begin processing the events off the
// queue.
ep.InitEventQueue()
ep.RunMetadataResolver(d.fetchK8sLabelsAndAnnotations)
}

Expand Down

0 comments on commit 290d9e9

Please sign in to comment.