Skip to content

fix(ingress): only flag IngressClass as missing on NotFound errors#1680

Open
AlexsJones wants to merge 1 commit into
mainfrom
fix/1668-ingress-class-notfound-only
Open

fix(ingress): only flag IngressClass as missing on NotFound errors#1680
AlexsJones wants to merge 1 commit into
mainfrom
fix/1668-ingress-class-notfound-only

Conversation

@AlexsJones

Copy link
Copy Markdown
Member

Problem

The ingress analyzer (pkg/analyzer/ingress.go) treated any error from IngressClasses().Get() as proof the class was missing — 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, 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 isGKEBuiltInIngressClass allowlist for every cloud provider (alb, nginx, traefik, …), we simply stop misreporting non-NotFound errors — which covers all controllers at once. The GKE allowlist is retained, since gce/gce-internal create no IngressClass resource at all.

Fix

Gate the failure on apierrors.IsNotFound(err) so only a genuinely absent IngressClass is reported.

Tests

  • Added TestIngressAnalyzerIngressClassGetError:
    • a present alb IngressClass reports no error;
    • a Forbidden error (via a fake reactor) is not misreported as a missing IngressClass.
  • Existing GKE/non-existent-class tests unchanged and passing.

Fixes #1668

🤖 Generated with Claude Code

@AlexsJones AlexsJones requested review from a team as code owners July 2, 2026 15:14
@github-project-automation github-project-automation Bot moved this to Proposed in Backlog Jul 2, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Proposed

Development

Successfully merging this pull request may close these issues.

[Bug] Ingress analyzer false positive for alb IngressClass. PR #1599 fixed GKE classes but missed AWS ALB and other cloud-provider controllers

1 participant