func (f *factory) loadInstanceFactory() biinstance.Factory { if f.instanceFactory != nil { return f.instanceFactory } f.instanceFactory = biinstance.NewFactory( f.loadBuilderFactory(), ) return f.instanceFactory }
mockStateBuilder.EXPECT().Build(jobName, jobIndex, gomock.Any(), gomock.Any()).Return(mockState, nil).AnyTimes() mockState.EXPECT().ToApplySpec().Return(applySpec).AnyTimes() } var newDeployCmd = func() Cmd { deploymentParser := bideplmanifest.NewParser(fs, logger) releaseSetValidator := birelsetmanifest.NewValidator(logger) releaseSetParser := birelsetmanifest.NewParser(fs, logger, releaseSetValidator) fakeRegistryUUIDGenerator = fakeuuid.NewFakeGenerator() fakeRegistryUUIDGenerator.GeneratedUUID = "registry-password" installationValidator := biinstallmanifest.NewValidator(logger) installationParser := biinstallmanifest.NewParser(fs, fakeRegistryUUIDGenerator, logger, installationValidator) deploymentValidator := bideplmanifest.NewValidator(logger) instanceFactory := biinstance.NewFactory(mockStateBuilderFactory) instanceManagerFactory := biinstance.NewManagerFactory(sshTunnelFactory, instanceFactory, logger) pingTimeout := 1 * time.Second pingDelay := 100 * time.Millisecond deploymentFactory := bidepl.NewFactory(pingTimeout, pingDelay) ui := biui.NewWriterUI(stdOut, stdErr, logger) doGet := func(deploymentManifestPath string) (DeploymentPreparer, error) { // todo: figure this out? deploymentStateService = biconfig.NewFileSystemDeploymentStateService(fs, fakeUUIDGenerator, logger, biconfig.DeploymentStatePath(deploymentManifestPath)) vmRepo = biconfig.NewVMRepo(deploymentStateService) diskRepo = biconfig.NewDiskRepo(deploymentStateService, fakeRepoUUIDGenerator) stemcellRepo = biconfig.NewStemcellRepo(deploymentStateService, fakeRepoUUIDGenerator) deploymentRepo = biconfig.NewDeploymentRepo(deploymentStateService) releaseRepo = biconfig.NewReleaseRepo(deploymentStateService, fakeRepoUUIDGenerator)