Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions internal/controller/overcommitclass/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,22 @@ func webhookChanged(updated, current interface{}) bool {
}
}

// Compare MatchConditions (including CEL expressions for namespace exclusion)
if len(updatedWebhook.MatchConditions) != len(currentWebhook.MatchConditions) {
return true
}

for i, updatedCondition := range updatedWebhook.MatchConditions {
if i >= len(currentWebhook.MatchConditions) {
return true
}
currentCondition := currentWebhook.MatchConditions[i]
if updatedCondition.Name != currentCondition.Name ||
updatedCondition.Expression != currentCondition.Expression {
return true
}
}

// If we reach here, they're likely the same
return false
}