fix(ingress): only flag IngressClass as missing on NotFound errors#1680
Open
AlexsJones wants to merge 1 commit into
Open
fix(ingress): only flag IngressClass as missing on NotFound errors#1680AlexsJones wants to merge 1 commit into
AlexsJones wants to merge 1 commit into
Conversation
The ingress analyzer treated any error from IngressClasses().Get() as proof the class did not exist, including non-NotFound errors such as RBAC Forbidden or API timeouts. On clusters using cloud-provider controllers (e.g. the AWS Load Balancer Controller's "alb" class) this produced false positives reporting a present IngressClass as missing, firing alerts every reconcile cycle. Gate the failure on apierrors.IsNotFound so only a genuinely absent IngressClass is reported. This covers all cloud-provider controllers rather than requiring an ever-growing hardcoded allowlist. Fixes #1668 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The ingress analyzer (
pkg/analyzer/ingress.go) treated any error fromIngressClasses().Get()as proof the class was missing — including non-NotFounderrors such as RBACForbiddenor API timeouts. On clusters using cloud-provider controllers (e.g. the AWS Load Balancer Controller'salbclass, per #1668) this reported a present IngressClass as missing and fired alerts every reconcile cycle.Note: this is a more general fix than the allowlist approach suggested in the issue. Rather than extending the GKE-specific
isGKEBuiltInIngressClassallowlist for every cloud provider (alb,nginx,traefik, …), we simply stop misreporting non-NotFounderrors — which covers all controllers at once. The GKE allowlist is retained, sincegce/gce-internalcreate no IngressClass resource at all.Fix
Gate the failure on
apierrors.IsNotFound(err)so only a genuinely absent IngressClass is reported.Tests
TestIngressAnalyzerIngressClassGetError:albIngressClass reports no error;Forbiddenerror (via a fake reactor) is not misreported as a missing IngressClass.Fixes #1668
🤖 Generated with Claude Code