Skip to content

Commit

Permalink
make hubble start with updated cilium dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ritwikranjan committed Jan 10, 2025
1 parent 2af1fe8 commit de0653a
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 51 deletions.
4 changes: 2 additions & 2 deletions cmd/hubble/cells_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ var (

pluginmanager.Cell,

retinak8s.Cell,

servermanager.Cell,

retinak8s.Cell,

telemetry.Heartbeat,
)
)
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ retract (
)

require (
cel.dev/expr v0.16.0 // indirect
cel.dev/expr v0.16.1 // indirect
code.cloudfoundry.org/clock v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
Expand Down Expand Up @@ -68,7 +68,7 @@ require (
github.com/cilium/dns v1.1.51-0.20240603182237-af788769786a // indirect
github.com/cilium/lumberjack/v2 v2.3.0 // indirect
github.com/cilium/stream v0.0.0-20240226091623-f979d32855f8 // indirect
github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20 // indirect
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect
github.com/containerd/cgroups/v3 v3.0.3 // indirect
github.com/containerd/containerd v1.7.23 // indirect
github.com/containerd/continuity v0.4.2 // indirect
Expand Down Expand Up @@ -185,7 +185,7 @@ require (
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/peterbourgon/diskv v2.0.2-0.20180312054125-0646ccaebea1+incompatible // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
Expand All @@ -194,7 +194,7 @@ require (
github.com/s3rj1k/go-fanotify/fanotify v0.0.0-20210917134616-9c00a300bb7a // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sasha-s/go-deadlock v0.3.5 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
Expand Down Expand Up @@ -229,8 +229,8 @@ require (
golang.org/x/tools v0.28.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241206012308-a4fef0638583 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
k8s.io/apiserver v0.30.3 // indirect
Expand Down Expand Up @@ -292,10 +292,10 @@ require (
github.com/aws/aws-sdk-go-v2/credentials v1.17.48
github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5
github.com/cilium/cilium v1.16.4
github.com/cilium/cilium v1.16.5
github.com/cilium/ebpf v0.16.0
github.com/cilium/hive v0.0.0-20240529072208-d997f86e4219
github.com/cilium/proxy v0.0.0-20240418093727-2c7164c53e26
github.com/cilium/proxy v0.0.0-20241210133824-eaae5aca0fb9
github.com/cilium/workerpool v1.2.0
github.com/florianl/go-tc v0.4.4
github.com/go-logr/zapr v1.3.0
Expand All @@ -322,7 +322,7 @@ require (
go.opentelemetry.io/otel/trace v1.33.0
go.uber.org/mock v0.5.0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
google.golang.org/grpc v1.67.0
google.golang.org/grpc v1.68.1
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gotest.tools v2.2.0+incompatible
gotest.tools/v3 v3.5.1
Expand Down
40 changes: 20 additions & 20 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cel.dev/expr v0.16.0 h1:yloc84fytn4zmJX2GU3TkXGsaieaV7dQ057Qs4sIG2Y=
cel.dev/expr v0.16.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg=
cel.dev/expr v0.16.1 h1:NR0+oFYzR1CqLFhTAqg3ql59G9VfN8fKq1TCHJ6gq1g=
cel.dev/expr v0.16.1/go.mod h1:AsGA5zb3WruAEQeQng1RZdGEXmBj0jvMWh6l5SnNuC8=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8=
Expand Down Expand Up @@ -198,8 +198,8 @@ github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHe
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/cilium v1.16.4 h1:YVyed/90Pfy5zyV1/v2uFLgcyWLj9/I4Sr3x3QGNRag=
github.com/cilium/cilium v1.16.4/go.mod h1:Wgi1kl0UaiOmnzFxNAr7rON5tMp4GaiQrIvp0b2gJE0=
github.com/cilium/cilium v1.16.5 h1:ecjhh98fl6Ki641+8Cdb0oynsy3toQ+oPLCSI3d+KLE=
github.com/cilium/cilium v1.16.5/go.mod h1:EqOosPzJuv28Hz3Ulz6cCXfYKbll7vbIwMGZU5houOw=
github.com/cilium/dns v1.1.51-0.20240603182237-af788769786a h1:PRGN7B+72mj3OtLL2DM3F/9jp+ItgqgNS7mecgCmwsQ=
github.com/cilium/dns v1.1.51-0.20240603182237-af788769786a/go.mod h1:/7LC2GOgyXJ7maupZlaVIumYQiGPIgllSf6mA9sg6RU=
github.com/cilium/ebpf v0.5.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs=
Expand All @@ -215,8 +215,8 @@ github.com/cilium/lumberjack/v2 v2.3.0 h1:IhVJMvPpqDYmQzC0KDhAoy7KlaRsyOsZnT97Ns
github.com/cilium/lumberjack/v2 v2.3.0/go.mod h1:yfbtPGmg4i//5oEqzaMxDqSWqgfZFmMoV70Mc2k6v0A=
github.com/cilium/metallb v0.1.1-0.20220829170633-5d7dfb1129f7 h1:ocC6/1Gz6LJd0XsJiwhcTlAy3yJrJruzh4sjRzUNvQs=
github.com/cilium/metallb v0.1.1-0.20220829170633-5d7dfb1129f7/go.mod h1:8nydvUTW+/9nVywCQ9bE/YGzb4EISALP4lKNpK3fFqo=
github.com/cilium/proxy v0.0.0-20240418093727-2c7164c53e26 h1:wzm/nEkcMO6oGSySoqe3/bMcF1sxrxI2ByidN3gg30A=
github.com/cilium/proxy v0.0.0-20240418093727-2c7164c53e26/go.mod h1:jzAmtWhlyR3kx+AwYdQvGM04lmHwsWhq1ySfAVpY/SA=
github.com/cilium/proxy v0.0.0-20241210133824-eaae5aca0fb9 h1:EuilS9EXYTKh2B8HXieDVMGaEf4Hleg5uA+07bt1l8c=
github.com/cilium/proxy v0.0.0-20241210133824-eaae5aca0fb9/go.mod h1:58Ngk9Jkge6TzFPVEsdcUQvIhtsE5fim3NMRgfrstqo=
github.com/cilium/statedb v0.2.4 h1:jCyXGcsiXgpJSfpfRRGKd+TD3U1teeDtOnqCyErsHsI=
github.com/cilium/statedb v0.2.4/go.mod h1:KPwsudjhZ90zoBguYMtssKpstR74jVKd/D+73PZy+sg=
github.com/cilium/stream v0.0.0-20240226091623-f979d32855f8 h1:j6VF1s6gz3etRH5ObCr0UUyJblP9cK5fbgkQTz8fTRA=
Expand All @@ -232,8 +232,8 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20 h1:N+3sFI5GUjRKBi+i0TxYVST9h4Ie192jJWpHvthBBgg=
github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 h1:QVw89YDxXxEe+l8gU8ETbOasdwEV+avkR75ZzsVV9WI=
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/containerd/cgroups/v3 v3.0.3 h1:S5ByHZ/h9PMe5IOQoN7E+nMc2UcLEM/V48DGDJ9kip0=
github.com/containerd/cgroups/v3 v3.0.3/go.mod h1:8HBe7V3aWGLFPd/k03swSIsGjZhHI2WzJmticMgVuz0=
github.com/containerd/containerd v1.7.23 h1:H2CClyUkmpKAGlhQp95g2WXHfLYc7whAuvZGBNYOOwQ=
Expand Down Expand Up @@ -770,8 +770,8 @@ github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/peterbourgon/diskv v2.0.2-0.20180312054125-0646ccaebea1+incompatible h1:FhnA4iH8T/yYW+AolPONZjGE897wxj3MAzfEbrZkSYw=
github.com/peterbourgon/diskv v2.0.2-0.20180312054125-0646ccaebea1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw=
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 h1:Ii+DKncOVM8Cu1Hc+ETb5K+23HdAMvESYE3ZJ5b5cMI=
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
Expand Down Expand Up @@ -831,8 +831,8 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU=
github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
Expand Down Expand Up @@ -952,8 +952,8 @@ go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8
go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s=
go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94=
go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A=
go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
go.starlark.net v0.0.0-20230814145427-12f4cb8177e4 h1:Ydko8M6UfXgvSpGOnbAjRMQDIvBheUsjBjkm6Azcpf4=
go.starlark.net v0.0.0-20230814145427-12f4cb8177e4/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
Expand Down Expand Up @@ -1164,10 +1164,10 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y=
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/genproto/googleapis/api v0.0.0-20241206012308-a4fef0638583 h1:v+j+5gpj0FopU0KKLDGfDo9ZRRpKdi5UBrCP0f76kuY=
google.golang.org/genproto/googleapis/api v0.0.0-20241206012308-a4fef0638583/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583 h1:IfdSdTcLFy4lqUQrQJLkLt1PB+AsqVz6lwkWPzWEz10=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
Expand All @@ -1176,8 +1176,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0=
google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
80 changes: 60 additions & 20 deletions pkg/k8s/cell_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ import (
"context"

daemonk8s "github.com/cilium/cilium/daemon/k8s"
"github.com/cilium/cilium/pkg/bgp/speaker"
cgmngr "github.com/cilium/cilium/pkg/cgroups/manager"
"github.com/cilium/cilium/pkg/datapath/iptables/ipset"
"github.com/cilium/cilium/pkg/datapath/tables"
"github.com/cilium/cilium/pkg/datapath/types"
"github.com/cilium/cilium/pkg/endpointmanager"
"github.com/cilium/cilium/pkg/identity/cache"
"github.com/cilium/cilium/pkg/ipcache"
"github.com/cilium/cilium/pkg/k8s"

Check failure on line 15 in pkg/k8s/cell_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, arm64)

dupImport: package is imported 2 times under different aliases on lines 15 and 16 (gocritic)

Check failure on line 15 in pkg/k8s/cell_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, amd64)

dupImport: package is imported 2 times under different aliases on lines 15 and 16 (gocritic)
ciliumk8s "github.com/cilium/cilium/pkg/k8s"
cilium_api_v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2"
cilium_api_v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1"
Expand All @@ -14,10 +21,16 @@ import (
slim_corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1"
slim_networkingv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1"
"github.com/cilium/cilium/pkg/k8s/synced"
"github.com/cilium/cilium/pkg/k8s/types"
k8sTypes "github.com/cilium/cilium/pkg/k8s/types"
"github.com/cilium/cilium/pkg/k8s/watchers"
"github.com/cilium/cilium/pkg/metrics"
"github.com/cilium/cilium/pkg/node"
"github.com/cilium/cilium/pkg/node/manager"
"github.com/cilium/cilium/pkg/policy"
"github.com/cilium/cilium/pkg/redirectpolicy"
"github.com/cilium/cilium/pkg/service"
"github.com/cilium/hive/cell"
"github.com/cilium/statedb"
"github.com/microsoft/retina/pkg/common"
"github.com/microsoft/retina/pkg/pubsub"
"github.com/sirupsen/logrus"
Expand All @@ -28,6 +41,16 @@ var Cell = cell.Module(
"k8s-watcher",
"Kubernetes watchers needed by the agent",

cell.Provide(
func() (statedb.Table[tables.NodeAddress], error) {
return statedb.NewTable(tables.NodeAddressTableName, tables.NodeAddressIndex)
},
),
cell.Invoke(func(db *statedb.DB, t statedb.Table[tables.NodeAddress]) {
db.RegisterTable(t)

Check failure on line 50 in pkg/k8s/cell_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, arm64)

Error return value of `db.RegisterTable` is not checked (errcheck)

Check failure on line 50 in pkg/k8s/cell_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, amd64)

Error return value of `db.RegisterTable` is not checked (errcheck)
}),
cell.Provide(k8s.NewServiceCache),

cell.Provide(
func(cell.Lifecycle, client.Clientset) (daemonk8s.LocalPodResource, error) {
return &fakeresource[*slim_corev1.Pod]{}, nil
Expand Down Expand Up @@ -59,17 +82,36 @@ var Cell = cell.Module(
func() resource.Resource[*cilium_api_v2.CiliumNode] {
return &fakeresource[*cilium_api_v2.CiliumNode]{}
},
func() daemonk8s.EndpointsNonHeadless {
return &fakeresource[*ciliumk8s.Endpoints]{}
},
func() watchers.WatcherConfiguration {
return &watcherconfig{}
},
),

metrics.Cell,

endpointmanager.Cell,

cell.Provide(func() *policy.Updater {
return &policy.Updater{}
}),

cell.Provide(func() *redirectpolicy.Manager {
return &redirectpolicy.Manager{}
}),

cell.Provide(func() types.BandwidthManager {
return &fakeBandwidthManager{}
}),

cell.Provide(func() service.ServiceManager {
return &service.Service{}
}),

cgmngr.Cell,

// Provide the resources needed by the watchers.

cell.Provide(func(lc cell.Lifecycle, cs client.Clientset) (resource.Resource[*types.CiliumEndpoint], error) {
cell.Provide(func(lc cell.Lifecycle, cs client.Clientset) (resource.Resource[*k8sTypes.CiliumEndpoint], error) {
return ciliumk8s.CiliumSlimEndpointResource(ciliumk8s.CiliumResourceParams{
Lifecycle: lc,
ClientSet: cs,
Expand All @@ -96,18 +138,6 @@ var Cell = cell.Module(
)
}),

cell.Provide(func(lc cell.Lifecycle, cs client.Clientset) (daemonk8s.ServiceNonHeadless, error) {
//nolint:wrapcheck // a wrapped error here is of dubious value
return ciliumk8s.ServiceResource(
lc,
ciliumk8s.Config{
EnableK8sEndpointSlice: false,
},
cs,
func(*metav1.ListOptions) {},
)
}),

// Provide everything needed for the watchers.
cell.Provide(func() *ipcache.IPCache {
iao := &identityAllocatorOwner{}
Expand All @@ -129,13 +159,23 @@ var Cell = cell.Module(
}
}),

node.LocalNodeStoreCell,
cell.Provide(func() ipset.Manager {
return &fakeIpsetMgr{}
}),

watchers.Cell,
cell.Provide(func() speaker.MetalLBBgpSpeaker {
return &fakeMetalLBBgpSpeaker{}
}),

synced.Cell,
manager.Cell,

node.LocalNodeStoreCell,

synced.Cell,
cell.Provide(newAPIServerEventHandler),

watchers.Cell,

cell.Invoke(func(a *APIServerEventHandler) {
ps := pubsub.New()
fn := pubsub.CallBackFunc(a.handleAPIServerEvent)
Expand Down
44 changes: 44 additions & 0 deletions pkg/k8s/placeholders_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import (
"sync"
"time"

"github.com/cilium/cilium/pkg/datapath/iptables/ipset"
datapathtypes "github.com/cilium/cilium/pkg/datapath/types"
"github.com/cilium/cilium/pkg/endpoint"
"github.com/cilium/cilium/pkg/identity"
"github.com/cilium/cilium/pkg/identity/cache"
"github.com/cilium/cilium/pkg/ipcache"
"github.com/cilium/cilium/pkg/k8s"
"github.com/cilium/cilium/pkg/k8s/resource"
slim_corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1"
nodetypes "github.com/cilium/cilium/pkg/node/types"
Expand Down Expand Up @@ -135,3 +137,45 @@ type datapathhandler struct{}
func (d *datapathhandler) UpdatePolicyMaps(context.Context, *sync.WaitGroup) *sync.WaitGroup {
return &sync.WaitGroup{}
}

type fakeBandwidthManager struct{}

func (f *fakeBandwidthManager) BBREnabled() bool {
return false
}

func (f *fakeBandwidthManager) Enabled() bool {
return false
}

func (f *fakeBandwidthManager) UpdateBandwidthLimit(uint16, uint64) {}

func (f *fakeBandwidthManager) DeleteBandwidthLimit(uint16) {}

type fakeDatapath struct{}

Check failure on line 155 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, arm64)

type `fakeDatapath` is unused (unused)

Check failure on line 155 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, amd64)

type `fakeDatapath` is unused (unused)

func (f *fakeDatapath) GetEndpointNetnsCookieByIP(netip.Addr) (uint64, error) {

Check failure on line 157 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, arm64)

func `(*fakeDatapath).GetEndpointNetnsCookieByIP` is unused (unused)

Check failure on line 157 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, amd64)

func `(*fakeDatapath).GetEndpointNetnsCookieByIP` is unused (unused)
return 0, nil
}

type fakeIpsetMgr struct{}

func (f *fakeIpsetMgr) NewInitializer() ipset.Initializer {
return nil
}

func (f *fakeIpsetMgr) AddToIPSet(name string, family ipset.Family, addrs ...netip.Addr) {}

Check failure on line 167 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, arm64)

unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)

Check failure on line 167 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, amd64)

unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)

func (f *fakeIpsetMgr) RemoveFromIPSet(name string, addrs ...netip.Addr) {}

Check failure on line 169 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, arm64)

unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)

Check failure on line 169 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, amd64)

unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)

type fakeMetalLBBgpSpeaker struct{}

func (f *fakeMetalLBBgpSpeaker) OnUpdateEndpoints(eps *k8s.Endpoints) error {

Check failure on line 173 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, arm64)

unused-parameter: parameter 'eps' seems to be unused, consider removing or renaming it as _ (revive)

Check failure on line 173 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, amd64)

unused-parameter: parameter 'eps' seems to be unused, consider removing or renaming it as _ (revive)
return nil
}
func (f *fakeMetalLBBgpSpeaker) OnUpdateService(svc *slim_corev1.Service) error {

Check failure on line 176 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, arm64)

unused-parameter: parameter 'svc' seems to be unused, consider removing or renaming it as _ (revive)

Check failure on line 176 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, amd64)

unused-parameter: parameter 'svc' seems to be unused, consider removing or renaming it as _ (revive)
return nil
}
func (f *fakeMetalLBBgpSpeaker) OnDeleteService(svc *slim_corev1.Service) error {

Check failure on line 179 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, arm64)

unused-parameter: parameter 'svc' seems to be unused, consider removing or renaming it as _ (revive)

Check failure on line 179 in pkg/k8s/placeholders_linux.go

View workflow job for this annotation

GitHub Actions / Lint (linux, amd64)

unused-parameter: parameter 'svc' seems to be unused, consider removing or renaming it as _ (revive)
return nil
}

0 comments on commit de0653a

Please sign in to comment.