New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nodehandler: register node-id restore as hive lifecycle hook #25497
nodehandler: register node-id restore as hive lifecycle hook #25497
Conversation
This commit moves the node id restore from the daemon to the hive cell - where it's implemented as hive lifecycle hook. Otherwise, dependent components are trying to lookup node ids before the actual restoration - which results in newly allocated node ids. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
|
||
params.LC.Append(hive.Hook{ | ||
OnStart: func(hive.HookContext) error { | ||
datapath.Node().RestoreNodeIDs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: RestoreNodeIDs
will implicitly enforce opening the BPF map if it's not already opened - which is the case with this move because the OnStart lifecycle hook will be executed before the initialization of the BPF map in the daemon init.
see https://github.com/cilium/cilium/blob/main/pkg/ebpf/map.go#L177-L181
anyway - i'll come up with an additional PR which will refactor the node map to be provided as hive cell after this one got merged. This will make this dependency visible and correct the initialization order.
/test |
edit: git checkout failed: /test-1.25-4.19 |
edit: git checkout failed: /test-runtime |
edit: git checkout failed: /test-1.26-net-next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This commit moves the node id restore from the daemon to the datapath hive cell (which instantiates the
linuxNodeHandler
) - where it's implemented as hive lifecycle hook.Otherwise, dependent components are trying to lookup node ids before the actual restoration - which results in unnecessary newly allocated node ids.