deps: bump cilium to v1.20.0 and migrate relocated internal APIs - #2628
Open
Quang Nguyen (nddq) wants to merge 1 commit into
Open
deps: bump cilium to v1.20.0 and migrate relocated internal APIs#2628Quang Nguyen (nddq) wants to merge 1 commit into
Quang Nguyen (nddq) wants to merge 1 commit into
Conversation
Retina Code Coverage ReportTotal coverage increased from
|
| Impacted Files | Coverage | |
|---|---|---|
| operator/cmd/cilium-crds/zap_linux.go | 0.0% ... 100.0% (100.0%) |
⬆️ |
| cmd/hubble/daemon_main_linux.go | 0.0% ... 3.7% (3.7%) |
⬆️ |
| operator/cmd/cilium-crds/lifecycle.go | 33.3% ... 100.0% (66.7%) |
⬆️ |
| operator/cmd/cilium-crds/root_linux.go | 0.0% ... 5.04% (5.04%) |
⬆️ |
| pkg/controllers/daemon/nodereconciler/node_controller_linux.go | 0.0% ... 12.5% (12.5%) |
⬆️ |
Quang Nguyen (nddq)
force-pushed
the
deps/cilium-1.20
branch
from
August 7, 2026 20:17
0fdfd7c to
4763faf
Compare
Quang Nguyen (nddq)
marked this pull request as ready for review
August 7, 2026 20:55
Quang Nguyen (nddq)
requested review from
Alexander (QxBytes) and
Ritwik Ranjan (ritwikranjan)
August 7, 2026 20:55
Quang Nguyen (nddq)
force-pushed
the
deps/cilium-1.20
branch
4 times, most recently
from
August 12, 2026 17:04
1701e50 to
d9c1822
Compare
Quang Nguyen (nddq)
requested
a balanced review from Copilot
and removed request for
Ritwik Ranjan (ritwikranjan)
August 13, 2026 14:47
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Retina’s embedded Cilium Hive integrations to Cilium v1.20.0 while preserving Hubble enrichment and operator behavior.
Changes:
- Upgrades Cilium, Kubernetes, eBPF, Hive, StateDB, and related dependencies.
- Migrates relocated APIs and updates agent/operator dependency wiring.
- Fixes concurrent node-handler registration and adds Hive-resolution tests.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pkg/k8s/placeholders_linux.go |
Removes obsolete policy stubs. |
pkg/k8s/local_node_synchronizer_linux.go |
Implements the new synchronizer method. |
pkg/k8s/cell_linux.go |
Migrates Cilium watcher and datapath wiring. |
pkg/controllers/daemon/nodereconciler/node_controller_linux.go |
Makes handler registration identity-based and synchronized. |
pkg/controllers/daemon/nodereconciler/node_controller_linux_test.go |
Tests concurrent same-name handlers. |
pkg/controllers/daemon/nodereconciler/cell_linux.go |
Updates the handler map type. |
operator/cmd/cilium-crds/root_linux.go |
Localizes leader-election configuration. |
operator/cmd/cilium-crds/lifecycle.go |
Associates jobs with leader lifecycle. |
operator/cmd/cilium-crds/hive_linux_test.go |
Verifies operator Hive resolution. |
operator/cmd/cilium-crds/flags.go |
Migrates operator flags. |
operator/cmd/cilium-crds/cells_linux.go |
Updates operator cell wiring and ordering. |
operator/cmd/cilium-crds/cells_linux_test.go |
Updates authentication graph setup. |
go.sum |
Refreshes dependency checksums. |
go.mod |
Upgrades Cilium and transitive dependencies. |
deploy/standard/manifests/controller/helm/retina/crds/retina.sh_tracesconfigurations.yaml |
Updates generator annotation. |
deploy/standard/manifests/controller/helm/retina/crds/retina.sh_retinaendpoints.yaml |
Updates generator annotation. |
deploy/standard/manifests/controller/helm/retina/crds/retina.sh_metricsconfigurations.yaml |
Updates generator annotation. |
deploy/standard/manifests/controller/helm/retina/crds/retina.sh_captures.yaml |
Regenerates capture CRD metadata ordering. |
cmd/hubble/cells_linux_test.go |
Verifies agent Hive resolution. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Cilium v1.20 repurposed pkg/datapath/types into generated BPF C bindings and moved every Go interface it held into per-subsystem packages, so this bump needs code changes rather than a go.mod edit alone. It also pulls k8s.io/* 0.35.x -> 0.36.3, controller-runtime 0.23.3 -> 0.24.1, cilium/ebpf 0.21.0 -> 0.22.0, cilium/statedb 0.5.6 -> 0.8.3, cilium/hive -> v1.0.4, and controller-tools 0.19.0 -> 0.20.1. Track the moved APIs: datapath.NodeHandler -> node.Handler, datapath.IptablesManager -> iptables.Manager, datapath.IPsecConfig -> ipsectypes.Config, wgtypes.WireguardConfig -> wgtypes.Config, and daemonk8s.PodTableCell/NamespaceTableCell -> pkg/k8s/tables. The monolithic pkg/datapath/fake/types split into per-subsystem fake packages. PolicyRepository swapped GetSelectorPolicy for ComputeSelectorPolicy, and LocalNodeSynchronizer gained WaitForNodeInformation. CiliumSlimEndpointResource's second parameter was an ignored _ *node.LocalNodeStore in v1.19, so Retina passed nil. v1.20 added a localNode indexer that reads it on every CiliumEndpoint add, which panics the informer and crash-loops the agent. Pass the real store, plus the Logger and MetricsProvider fields that were also left nil. Fix two defects in the node handler registry that v1.20's hubble peer service makes reachable (it subscribes one handler per gRPC Notify stream): Subscribe wrote the handlers map under RLock, so two concurrent peer streams crash the agent with concurrent map writes; and the map was keyed by Name(), which every peer handler reports as the constant "hubble-peer", so a second stream evicted the first and the departing stream's Unsubscribe deafened the survivor. Key the set by handler identity, matching upstream's nodeManager, and lock exclusively. A regression test covers both under -race. On the operator, auth.Cell gained a ztunnel.Config dependency in v1.20; main's authenticationCell (ztunnel.Cell + auth.Cell) already satisfies it, but v1.20's ztunnel.Cell builds the namespace reflector at Populate time, so TestAuthenticationGraph now uses the fake clientset instead of nil and cilium's pkg/hive wrapper for the statedb and job providers it pulls in. operatorMetrics.SharedConfig and endpointgc.SharedConfig.Interval are gone because those cells now own --enable-metrics and --cilium-endpoint-gc-interval through cell.Config, so drop the duplicate registrations. Leader-election flag names and config fields are no longer exported from operator/option; declare them locally under the same names and defaults so existing operator configuration keeps working. With those readers gone nothing consumes *operatorOption.OperatorConfig, so drop its provider and Populate call. Align the WithLeaderLifecycle copy with upstream v1.20 by also decorating job.Registry, so leader-scoped cells that adopt job.Group attach jobs to the post-election lifecycle, and move the registerOperatorHooks invoke to the end of the module per upstream's ordering requirement. v1.19's watcher constructors took an agentK8s.Resources bundle struct, which forced every field in it to be resolvable and is why Retina carried 20 no-op DI providers. v1.20 rewrote those constructors to depend on narrow types, leaving 12 of the providers and all of NoOpPolicyRepository unreachable. Remove them, and add tests that resolve both the agent and operator hives so a newly required provider fails in CI rather than on a cluster. Regenerate the CRDs with controller-gen v0.20.1: an annotation bump on all four and one property reorder in retina.sh_captures.yaml, no schema change. Signed-off-by: Quang Nguyen <28567936+nddq@users.noreply.github.com>
Quang Nguyen (nddq)
force-pushed
the
deps/cilium-1.20
branch
from
August 14, 2026 14:26
d9c1822 to
83ee19f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bumps
github.com/cilium/ciliumv1.19.4→v1.20.0. The bump transitively pullsk8s.io/*0.36.3,controller-runtime0.24.1,cilium/ebpf0.22.0,cilium/statedb0.8.3, andcilium/hivev1.0.4.Retina embeds part of Cilium's Hive graph to enrich Hubble flows. v1.20 replaced
pkg/datapath/typeswith generated BPF bindings and moved the interfaces that Retina uses. The bump therefore needs these code changes:API moves:
datapath.NodeHandler→node.Handlerdatapath.IptablesManager→iptables.Managertypes.Configpkg/datapath/fake/types→ per-subsystemfakepackagesdaemonk8stable cells →pkg/k8s/tablesNew interface method:
LocalNodeSynchronizergainsWaitForNodeInformation. Retina's implementation returns at once, becauseInitLocalNodeseedsNODE_IPsynchronously.Nil dereference fix: v1.19 ignored the
*node.LocalNodeStoreparameter ofCiliumSlimEndpointResource. v1.20 reads it in a new pod indexer, so thenilthat Retina passed panics the informer on the first CiliumEndpoint. Retina now passes the real store and also sets theLoggerandMetricsProviderfields.Node handler registry: in v1.20, the Hubble peer service subscribes one handler per gRPC
Notifystream. This makes two defects reachable:Subscribewrote to the handlers map under a read lock. Two concurrent streams corrupt the map and crash the agent.Name(). Every peer handler is named"hubble-peer", so a second stream evicts the first.The registry now keys handlers by identity under an exclusive lock. Upstream does the same.
Operator cleanup: v1.20's metrics and endpoint-GC cells own their configuration through
cell.Config, andoperator/optionstopped exporting the leader-election flag names. This PR:*operatorOption.OperatorConfigprovider and theSharedConfigplumbing that read itjob.Registryto the leader lifecycle and invokesregisterOperatorHookslast — both match upstream v1.20Stub cleanup: v1.20 rewrote the watcher constructors to depend on narrow types instead of the
agentK8s.Resourcesbundle. That rewrite made 12 of Retina's 20 stub providers and all ofNoOpPolicyRepositoryunreachable. This PR removes them: net−84lines inpkg/k8s.CRDs: regenerated with
controller-genv0.20.1. Only thecontroller-genversion annotation changes. The schemas are identical.Related Issue
N/A.
Checklist
git commit -S -s ...). See this documentation on signing commits.Screenshots (if applicable) or Testing Completed
The new
TestAgentHiveResolvesandTestOperatorHiveResolvesresolve the agent and operator hives at test time. If a future Cilium bump adds a required provider, these tests fail in CI before the change crash-loops on a cluster. Without theSubscribefix, the race test fails withDATA RACE.Deployed to a 2-node AKS cluster (Kubernetes
1.35.6):ebpfv0.22.0, and every metric family exported data.The peer-stream tests targeted the handler-registry fixes:
concurrent maperrors.Upgrade path: installed the released
retina-hubblev1.2.3chart, which pinsciliumv1.19.3, then ranhelm upgradeto these images. The rollout was clean. The Cilium CRD specs hash identically before and after the upgrade, so v1.20 accepts CRDs that a v1.19 operator created. The TLS variant (hubble.tls.enabled=true) passed the same checks.Additional Notes
N/A.