Skip to content

Commit bad7cdb

Browse files
rastislavsYutaroHayakawa
authored andcommitted
bgpv1: Provide Frontends table to bgpv1 component tests
It is not used by BGPv1, but necessary to build up the test hive. Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com>
1 parent 704c65e commit bad7cdb

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

pkg/bgpv1/test/fixtures.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
slim_meta_v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/meta/v1"
3838
clientset_core_v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1"
3939
"github.com/cilium/cilium/pkg/k8s/utils"
40+
"github.com/cilium/cilium/pkg/loadbalancer"
4041
"github.com/cilium/cilium/pkg/metrics"
4142
"github.com/cilium/cilium/pkg/option"
4243
)
@@ -175,6 +176,7 @@ func newFixture(t testing.TB, ctx context.Context, conf fixtureConfig) (*fixture
175176
// Construct a new Hive with mocked out dependency cells.
176177
f.cells = []cell.Cell{
177178
cell.Config(k8sPkg.DefaultConfig),
179+
cell.Provide(func() loadbalancer.Config { return loadbalancer.DefaultConfig }),
178180

179181
cell.Provide(k8sPkg.DefaultServiceWatchConfig),
180182

@@ -203,13 +205,16 @@ func newFixture(t testing.TB, ctx context.Context, conf fixtureConfig) (*fixture
203205
return f.fakeClientSet
204206
}),
205207

206-
// Provide route and device tables
208+
// Provide statedb tables
207209
cell.Provide(
208210
tables.NewRouteTable,
209211
tables.NewDeviceTable,
210-
statedb.RWTable[*tables.Route].ToTable, // Table[*Route]
211-
statedb.RWTable[*tables.Device].ToTable, // Table[*Device]
212+
loadbalancer.NewFrontendsTable,
213+
statedb.RWTable[*tables.Route].ToTable, // Table[*Route]
214+
statedb.RWTable[*tables.Device].ToTable, // Table[*Device]
215+
statedb.RWTable[*loadbalancer.Frontend].ToTable, // Table[*loadbalancer.Frontend]]
212216
),
217+
213218
// daemon config
214219
cell.Provide(func() *option.DaemonConfig {
215220
return &option.DaemonConfig{

0 commit comments

Comments
 (0)