Skip to content

Commit 8cddb62

Browse files
committed
Simplify logic around suspension state change
1 parent 9e14eff commit 8cddb62

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

internal/watch/watcher.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ func (w *Watcher) checkSuspensionStatus(ctx context.Context, resource k8s.Resour
103103
}
104104
suspended, _ := spec["suspend"].(bool)
105105

106-
var updated bool
107106
entry, err := w.store.GetEntry(resource)
108107
if err != nil {
109108
if errors.Is(err, datastore.ErrNotFound) {
@@ -120,11 +119,9 @@ func (w *Watcher) checkSuspensionStatus(ctx context.Context, resource k8s.Resour
120119
return nil
121120
}
122121
return fmt.Errorf("failed to fetch entry: %w", err)
123-
} else {
124-
updated = suspended != entry.Suspended
125122
}
126123

127-
if !updated {
124+
if suspended == entry.Suspended {
128125
return nil // Probably something else about the resource modified
129126
}
130127

0 commit comments

Comments
 (0)