Skip to content

Commit

Permalink
endpoint: Overwrite endpoint datapath config. on restore
Browse files Browse the repository at this point in the history
On agent restarts, we serialize the endpoints to their header file to be
able to restore them afterward. That means we also restore their
datapath configuration regardless of any change in the agent's settings
(e.g., status of per-endpoint routes).

We therefore ignores changes to the per-endpoint routes setting
(enable-endpoint-routes).

Signed-off-by: Paul Chaignon <paul@cilium.io>
  • Loading branch information
pchaigno authored and kkourt committed Mar 10, 2021
1 parent 6ca568a commit a9ecab1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/endpoint/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,9 @@ func parseEndpoint(ctx context.Context, owner regeneration.Owner, bEp []byte) (*
// If host label is present, it's the host endpoint.
ep.isHost = ep.HasLabels(labels.LabelHost)

// Overwrite datapath configuration with the current agent configuration.
ep.DatapathConfiguration = NewDatapathConfiguration()

// We need to check for nil in Status, CurrentStatuses and Log, since in
// some use cases, status will be not nil and Cilium will eventually
// error/panic if CurrentStatus or Log are not initialized correctly.
Expand Down

0 comments on commit a9ecab1

Please sign in to comment.