Skip to content

Commit 658564d

Browse files
authored
Merge pull request kubernetes#86120 from answer1991/feature/change-fakewatcher-private-field
change FakeWatcher.Stopped to be a private field
2 parents ca78590 + a8839a9 commit 658564d

File tree

1 file changed

+5
-5
lines changed
  • staging/src/k8s.io/apimachinery/pkg/watch

1 file changed

+5
-5
lines changed

staging/src/k8s.io/apimachinery/pkg/watch/watch.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (w emptyWatch) ResultChan() <-chan Event {
9090
// FakeWatcher lets you test anything that consumes a watch.Interface; threadsafe.
9191
type FakeWatcher struct {
9292
result chan Event
93-
Stopped bool
93+
stopped bool
9494
sync.Mutex
9595
}
9696

@@ -110,24 +110,24 @@ func NewFakeWithChanSize(size int, blocking bool) *FakeWatcher {
110110
func (f *FakeWatcher) Stop() {
111111
f.Lock()
112112
defer f.Unlock()
113-
if !f.Stopped {
113+
if !f.stopped {
114114
klog.V(4).Infof("Stopping fake watcher.")
115115
close(f.result)
116-
f.Stopped = true
116+
f.stopped = true
117117
}
118118
}
119119

120120
func (f *FakeWatcher) IsStopped() bool {
121121
f.Lock()
122122
defer f.Unlock()
123-
return f.Stopped
123+
return f.stopped
124124
}
125125

126126
// Reset prepares the watcher to be reused.
127127
func (f *FakeWatcher) Reset() {
128128
f.Lock()
129129
defer f.Unlock()
130-
f.Stopped = false
130+
f.stopped = false
131131
f.result = make(chan Event)
132132
}
133133

0 commit comments

Comments
 (0)