func createTestRuntimeManager() (*apitest.FakeRuntimeService, *apitest.FakeImageService, *kubeGenericRuntimeManager, error) { fakeRuntimeService := apitest.NewFakeRuntimeService() fakeImageService := apitest.NewFakeImageService() networkPlugin, _ := network.InitNetworkPlugin( []network.NetworkPlugin{}, "", nettest.NewFakeHost(nil), componentconfig.HairpinNone, "10.0.0.0/8", ) osInterface := &containertest.FakeOS{} manager, err := NewFakeKubeRuntimeManager(fakeRuntimeService, fakeImageService, networkPlugin, osInterface) return fakeRuntimeService, fakeImageService, manager, err }
func createTestRuntimeManager() (*apitest.FakeRuntimeService, *apitest.FakeImageService, *kubeGenericRuntimeManager, error) { fakeRuntimeService := apitest.NewFakeRuntimeService() fakeImageService := apitest.NewFakeImageService() // Only an empty machineInfo is needed here, because in unit test all containers are besteffort, // data in machineInfo is not used. If burstable containers are used in unit test in the future, // we may want to set memory capacity. machineInfo := &cadvisorapi.MachineInfo{} networkPlugin, _ := network.InitNetworkPlugin( []network.NetworkPlugin{}, "", nettest.NewFakeHost(nil), componentconfig.HairpinNone, "10.0.0.0/8", network.UseDefaultMTU, ) osInterface := &containertest.FakeOS{} manager, err := NewFakeKubeRuntimeManager(fakeRuntimeService, fakeImageService, machineInfo, networkPlugin, osInterface) return fakeRuntimeService, fakeImageService, manager, err }
func createTestFakeRuntimeManager() (*apitest.FakeRuntimeService, *apitest.FakeImageService, *kubeGenericRuntimeManager, error) { fakeRuntimeService := apitest.NewFakeRuntimeService() fakeImageService := apitest.NewFakeImageService() manager, err := NewFakeKubeRuntimeManager(fakeRuntimeService, fakeImageService) return fakeRuntimeService, fakeImageService, manager, err }