Skip to content

Commit

Permalink
Use atomic.Bool in FailOnActionReactor
Browse files Browse the repository at this point in the history
...instead of atomic.Value.

Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis authored and sridhargaddam committed Oct 25, 2023
1 parent 47ffc6b commit 545d893
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/fake/fail_on_action_reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

type FailOnActionReactor struct {
fail atomic.Value
fail atomic.Bool
}

func (r *FailOnActionReactor) Fail(v bool) {
Expand All @@ -47,7 +47,7 @@ func FailOnAction(f *testing.Fake, resource, verb string, customErr error, autoR
defer f.Unlock()

f.PrependReactor(verb, resource, func(action testing.Action) (bool, runtime.Object, error) {
if r.fail.Load().(bool) {
if r.fail.Load() {
if autoReset {
r.fail.Store(false)
}
Expand Down

0 comments on commit 545d893

Please sign in to comment.