Skip to content
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

Merged
merged 1 commit into from May 18, 2023

Conversation

mhofstetter
Copy link
Member

@mhofstetter mhofstetter commented May 17, 2023

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.

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>
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 17, 2023

params.LC.Append(hive.Hook{
OnStart: func(hive.HookContext) error {
datapath.Node().RestoreNodeIDs()
Copy link
Member Author

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.

@mhofstetter mhofstetter added the release-note/misc This PR makes changes that have no direct user impact. label May 17, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 17, 2023
@mhofstetter mhofstetter marked this pull request as ready for review May 17, 2023 07:36
@mhofstetter mhofstetter requested review from a team as code owners May 17, 2023 07:36
@mhofstetter mhofstetter requested a review from ldelossa May 17, 2023 07:36
@mhofstetter
Copy link
Member Author

/test

@mhofstetter
Copy link
Member Author

mhofstetter commented May 17, 2023

edit: git checkout failed: hudson.plugins.git.GitException: Failed to fetch from https://github.com/cilium/cilium

/test-1.25-4.19

@mhofstetter
Copy link
Member Author

mhofstetter commented May 17, 2023

edit: git checkout failed: hudson.plugins.git.GitException: Failed to fetch from https://github.com/cilium/cilium -> #25505

/test-runtime

@mhofstetter
Copy link
Member Author

mhofstetter commented May 17, 2023

edit: git checkout failed: hudson.plugins.git.GitException: Failed to fetch from https://github.com/cilium/cilium

/test-1.26-net-next

Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 17, 2023
@aditighag aditighag merged commit 604afd0 into cilium:main May 18, 2023
59 checks passed
@mhofstetter mhofstetter deleted the pr/mhofstetter/nodemap-restore branch May 19, 2023 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants