func init() { ProvisionerInstance = NewFakeProvisioner() ExtensibleInstance = &ExtensibleFakeProvisioner{ FakeProvisioner: ProvisionerInstance, } provision.Register("fake", func() (provision.Provisioner, error) { return ProvisionerInstance, nil }) provision.Register("fake-extensible", func() (provision.Provisioner, error) { return ExtensibleInstance, nil }) }
func (s *S) TestShouldRegisterAllCommandsFromProvisioners(c *check.C) { fp := provisiontest.NewFakeProvisioner() p := AdminCommandableProvisioner{FakeProvisioner: *fp} provision.Register("fakeAdminProvisioner", &p) manager := buildManager("tsuru-admin") fake, ok := manager.Commands["fake-admin"] c.Assert(ok, check.Equals, true) c.Assert(fake, check.FitsTypeOf, &FakeAdminCommand{}) }
func (s *S) TestShouldRegisterAllCommandsFromProvisioners(c *gocheck.C) { fp := testing.NewFakeProvisioner() p := CommandableProvisioner{FakeProvisioner: *fp} provision.Register("comm", &p) manager := buildManager() fake, ok := manager.Commands["fake"] c.Assert(ok, gocheck.Equals, true) tsrFake, ok := fake.(*tsrCommand) c.Assert(ok, gocheck.Equals, true) c.Assert(tsrFake.Command, gocheck.FitsTypeOf, &FakeCommand{}) }
func (s *S) TestShouldRegisterAllCommandsFromProvisioners(c *check.C) { fp := provisiontest.NewFakeProvisioner() p := CommandableProvisioner{FakeProvisioner: fp} provision.Register("comm", func() (provision.Provisioner, error) { return &p, nil }) manager := buildManager() fake, ok := manager.Commands["fake"] c.Assert(ok, check.Equals, true) tsurudFake, ok := fake.(*tsurudCommand) c.Assert(ok, check.Equals, true) c.Assert(tsurudFake.Command, check.FitsTypeOf, &FakeCommand{}) }
func init() { mainDockerProvisioner = &dockerProvisioner{} provision.Register("docker", mainDockerProvisioner) }
func init() { provision.Register("fake", &FakeProvisioner{}) }
func init() { provision.Register("juju", &JujuProvisioner{}) }
func init() { provision.Register(provisionerName, func() (provision.Provisioner, error) { return &swarmProvisioner{}, nil }) }
func init() { provision.Register("docker", &dockerProvisioner{}) }
func init() { provision.Register(provisionerName, func() (provision.Provisioner, error) { return &kubernetesProvisioner{}, nil }) }
func init() { mainDockerProvisioner = &dockerProvisioner{} provision.Register(provisionerName, func() (provision.Provisioner, error) { return mainDockerProvisioner, nil }) }