1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-08 18:15:48 +00:00

fix: Stop incorrect any block condition logging (#4107)

Previously the "no condition passed for 'any' block" would be logged for
all `any` blocks because the log line always occurs, even if conditions
are found.

Co-authored-by: Samuel Torres <samuel.torres@form3.tech>
Signed-off-by: Andrew Bulford <andrew.bulford@form3.tech>

Co-authored-by: Prateek Pandey <prateek.pandey@nirmata.com>
This commit is contained in:
Andrew Bulford 2022-06-15 16:39:24 +01:00 committed by GitHub
parent 051b0751e0
commit 11942560c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,9 @@ func evaluateAnyAllConditions(log logr.Logger, ctx context.EvalInterface, condit
}
}
log.Info("no condition passed for 'any' block", "any", anyConditions)
if !anyConditionsResult {
log.Info("no condition passed for 'any' block", "any", anyConditions)
}
}
// update the allConditionsResult if they are present