Skip to content

Commit 50254a3

Browse files
committed
fix(handler): Fixing bug on excluding a candidate
- fixed a stupid but deadly bug on candidate exclusion - should not be grabbing the same element over in the filter
1 parent 2ac20cf commit 50254a3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

swabbie-core/src/main/kotlin/com/netflix/spinnaker/swabbie/AbstractResourceTypeHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ abstract class AbstractResourceTypeHandler<T : Resource>(
323323
var shouldSkip = false
324324
val candidate = candidates.find { it.resourceId == r.resourceId }
325325
if ((candidate == null || candidate.getViolations().isEmpty()) ||
326-
shouldExcludeResource(candidates.first(), workConfiguration, optedOutResourceStates, Action.DELETE)) {
326+
shouldExcludeResource(candidate, workConfiguration, optedOutResourceStates, Action.DELETE)) {
327327
shouldSkip = true
328328
ensureResourceUnmarked(r, workConfiguration)
329329
}

0 commit comments

Comments
 (0)