Skip to content

Commit 4648631

Browse files
committed
fix condition reason checking
1 parent 336afc0 commit 4648631

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

internal/controller/state/graph/backend_tls_policy.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,8 @@ func addPolicyAncestorLimitCondition(
195195
policyName string,
196196
policyType string,
197197
) []conditions.Condition {
198-
const policyAncestorLimitReachedType = "PolicyAncestorLimitReached"
199-
200198
for i, condition := range conds {
201-
if condition.Type == policyAncestorLimitReachedType {
199+
if condition.Reason == string(conditions.PolicyReasonAncestorLimitReached) {
202200
if !strings.Contains(condition.Message, policyName) {
203201
conds[i].Message = fmt.Sprintf("%s, %s %s", condition.Message, policyType, policyName)
204202
}

0 commit comments

Comments
 (0)