Skip to content

Commit f57dd5d

Browse files
inteonvincepri
andcommitted
Rename NewCancelRunnable to RunnableWithCancel
Co-authored-by: Vince Prignano <[email protected]>
1 parent 9597b22 commit f57dd5d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/internal/controller/controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,9 @@ var _ = Describe("controller", func() {
346346
Expect(err.Error()).To(Equal("can not restart a stopped controller, you should create a new one"))
347347
})
348348

349-
It("should be possible to cancel the controller using NewCancelRunnable", func() {
349+
It("should be possible to cancel the controller using RunnableWithCancel", func() {
350350
stoppedChan := make(chan struct{})
351-
cancellableController, cancel := manager.NewCancelRunnable(ctrl)
351+
cancellableController, cancel := manager.RunnableWithCancel(ctrl)
352352

353353
go func() {
354354
defer close(stoppedChan)

pkg/manager/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ type LeaderElectionRunnable interface {
342342
NeedLeaderElection() bool
343343
}
344344

345-
// NewCancelRunnable returns a new Runnable and a function to cancel that runnable.
346-
func NewCancelRunnable(r Runnable) (Runnable, context.CancelFunc) {
345+
// RunnableWithCancel returns a new Runnable and a function to cancel that runnable.
346+
func RunnableWithCancel(r Runnable) (Runnable, context.CancelFunc) {
347347
mu := sync.Mutex{}
348348
var cancels []func()
349349
canceled := false

0 commit comments

Comments
 (0)