Skip to content

Operator fails on every standard Ingress in the cluster #65

@sujaya-sys

Description

@sujaya-sys

Problem Summary

The ingress controller is failing to reconcile any Ingress resources that don't have the k8s.checklyhq.com/group annotation, regardless of whether they have the k8s.checklyhq.com/enabled annotation or not. This causes the operator to log errors continuously for all ingresses in the cluster that aren't explicitly configured for Checkly monitoring.

Assumption

Is this a regression introduced in #49?

We changed the logic flow here:

Before: Check if enabled → If enabled, gather data (requires annotations)
After: Always gather data (requires annotations) → Then check if enabled

Steps to Reproduce

  • Deploy checkly-operator
  • Create any standard Kubernetes Ingress resource without Checkly annotations
  • Observe continuous error logs from the operator

Expected Behavior
Ingress resources without the k8s.checklyhq.com/enabled=true annotation should be ignored by the operator without errors.

Actual Behavior

{"level":"error","msg":"unable to gather data for the apiCheck resource","error":"could not find a value for the group annotation, can't continue without one"}

Proposed Fix

Move the enabled check before data gathering in the Reconcile method:

// Check if enabled FIRST (around line 75)
if value, exists := ingress.Annotations[annotationEnabled]; !exists || value == "false" {
    // Handle cleanup if needed and return early
    return ctrl.Result{}, nil
}
// ONLY gather data if enabled (requires annotations)
apiCheckResources, err := r.gatherApiCheckData(&ingress)
if err != nil {
    logger.Error(err, "unable to gather data for the apiCheck resource")
    return ctrl.Result{}, err
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions