Skip to content

Commit

Permalink
Make sure multiple controllers can be registered
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSpeed committed Sep 17, 2018
1 parent 803aa68 commit 73a8061
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ var _ = Describe("controller.Controller", func() {

close(done)
})

It("should not return an error if two controllers are registered with different names", func(done Done) {
m, err := manager.New(cfg, manager.Options{})
Expect(err).NotTo(HaveOccurred())

c1, err := controller.New("c1", m, controller.Options{Reconciler: rec})
Expect(err).NotTo(HaveOccurred())
Expect(c1).ToNot(BeNil())

c2, err := controller.New("c2", m, controller.Options{Reconciler: rec})
Expect(err).NotTo(HaveOccurred())
Expect(c2).ToNot(BeNil())

close(done)
})
})
})

Expand Down

0 comments on commit 73a8061

Please sign in to comment.