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
configmap & utime sync: provide via hive cell #24830
configmap & utime sync: provide via hive cell #24830
Conversation
) | ||
|
||
func initUtimeSync(lifecycle hive.Lifecycle, configMap configmap.Map) { | ||
controllerManager := controller.NewManager() |
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.
@joamaki would it be worth to have a provider for the controller manager?
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.
What do you think of #24558?
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.
interesting - will take a look.
i think something like this could help in this case - and could be refactored in the future (once its merged)
) | ||
|
||
func initUtimeSync(lifecycle hive.Lifecycle, configMap configmap.Map) { | ||
controllerManager := controller.NewManager() |
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.
What do you think of #24558?
pkg/maps/configmap/cell.go
Outdated
return fmt.Errorf("failed to init config map: %w", err) | ||
} | ||
|
||
return nil |
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.
Stop hook missing that closes it
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.
thanks - added!
48bc4fe
to
c40e3da
Compare
c40e3da
to
2a69f22
Compare
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
2a69f22
to
02a8a33
Compare
rebased and resolved conflicts |
} | ||
} | ||
|
||
type MapOut struct { |
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.
I usually try to avoid writing cell.Out
s with group values for the fear of typoing the group name. You can get around this with a helper, e.g. func NewMapOut[Map any](m Map) MapOut[Map]
, but perhaps not worth adding it just yet.
691bdff
to
4de20d8
Compare
/test |
/test-1.27-net-next |
) | ||
|
||
// Cell contains all cells which are providing BPF Maps. | ||
var Cell = cell.Module( |
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.
When should I add something here vs. to the datapath cell as done for the configmap?
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.
Ah nvm utime.Cell is not a map.
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.
exactly - utime just syncs the utime and uses the configmap to write from user- to kernelspace.
the cell of the configmap itself is part of the maps cell.
Currently, the interaction with the BPF map configmap and the corresponding utime sync is mainly via global accessors. This commit refactors this, by providing hive cells for the configmap and the utime sync. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit lets the datapath depend on all BPF maps which are managed by a hive cell. BPF Map cells can register their map to the registry via hive value group `bpf-maps` and the new BpfMap marker interface. This way, we ensure that BPF maps are initialized via their cell before the loader. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
Currently, the initialization of the auth map is mainly driven by the usage in the auth manager. To always guarantee the initialization before the bpf loader, with this commit, the auth map gets registered in the map registry. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
To always guarantee the initialization of the config bpf map before the bpf loader, with this commit, the auth map gets registered in the map registry. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
4de20d8
to
b796c01
Compare
rebased to main |
/test Job 'Cilium-PR-K8s-1.25-kernel-5.4' failed: Click to show.Test Name
Failure Output
Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.25-kernel-5.4/107/ If it is a flake and a GitHub issue doesn't already exist to track it, comment Job 'Cilium-PR-K8s-1.16-kernel-4.19' hit: #25068 (85.93% similarity) |
vagrant issues |
|
referenced ci-flake issues & code owners covered -> marking as |
why is this ready to merge? it's not approved by cilium/sig-datapath yet right? |
@michi-covalent jussi is part of sig-datapath and looks like the perfect reviewer for this :) |
oh yeah he is. sorry i got confused because yutaro is still listed as the code owner from sig-dapath. |
Currently, the interaction with the BPF map configmap and the corresponding utime sync is mainly via global accessors.
This commit refactors this, by introducing hive cells for the configmap and the utime sync.