Skip to content

bug: Operator throws error logs when resources are mentioned in FrontProxy CR #131

@MuneebAijaz

Description

@MuneebAijaz

Describe the bug

When resources part is mentioned in the FrontProxy CR, it throws error logs inside the kcp operator pod, which also blocks processing of the underlying Deployment

  resources:
    limits:
      cpu: 50m
      memory: 200Mi
    requests:
      cpu: 5m
      memory: 200Mi

Logs from operator pod

{"level":"error","ts":"2025-12-10T10:29:17.681Z","msg":"Reconciler error","controller":"frontproxy","controllerGroup":"operator.kcp.io","controllerKind":"FrontProxy","FrontProxy":{"name":"frontproxy","namespace":"kcp-config"},"namespace":"kcp-config","name":"frontproxy","reconcileID":"280907cc-69b7-44ab-b6d1-7de285502b74","error":"panic: assignment to entry in nil map [recovered]"}

{"level":"error","ts":"2025-12-10T10:29:19.652Z","msg":"Observed a panic","controller":"frontproxy","controllerGroup":"operator.kcp.io","controllerKind":"FrontProxy","FrontProxy":{"name":"frontproxy","namespace":"kcp-config"},"namespace":"kcp-config","name":"frontproxy","reconcileID":"a98637c6-be44-4a1f-8e77-15d23979f20e","panic":"assignment to entry in nil map","panicGoValue":"\"assignment to entry in nil map\"","stacktrace":"goroutine 561 [running]:\nk8s.io/apimachinery/pkg/util/runtime.logPanic({0x242cf48, 0xc004276de0}, {0x1dba600, 0x35cb320})\n\t/go/pkg/mod/k8s.io/apimachinery@v0.32.0/pkg/util/runtime/runtime.go:107 +0xbc\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile.func1()\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.0/pkg/internal/controller/controller.go:105 +0x112\npanic({0x1dba600?, 0x35cb320?})\n\t/usr/local/go/src/runtime/panic.go:792 +0x132\nmaps.Copy[...](...)\n\t/usr/local/go/src/maps/maps.go:64\ngithub.com/kcp-dev/kcp-operator/internal/resource...

Steps To Reproduce

  1. Create FrontProxy CR with resources mentioned
  2. It wont create the underlying deployment
  3. You will be able to see errors/panics in operator pod logs

Expected Behaviour

Resources section correctly applied to the underlying front proxy deployment

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions