Skip to content

fix: assign unique controller name to authconfig status updater - #690

Merged
mikenairn merged 1 commit into
mainfrom
fix_controller_name_validation_issue
Sep 18, 2026
Merged

mikenairn merged 1 commit into
mainfrom
fix_controller_name_validation_issue

Conversation

@mikenairn

@mikenairn mikenairn commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes controller startup failure caused by duplicate controller names when using controller-runtime v0.19+.

Problem

The Kubernetes version upgrade in PR #684 introduced controller-runtime v0.23, which includes stricter validation introduced in v0.19 that requires all controllers registered with the same manager to have unique names.

Both the AuthConfigReconciler and AuthConfigStatusUpdater reconcile the same resource type (AuthConfig). Without an explicit controller name, controller-runtime derives the name from the resource type, causing both to get the name "authconfig".

This causes Authorino to fail on startup with:

{
  "level": "error",
  "ts": "2026-09-17T19:08:07Z",
  "logger": "authorino",
  "msg": "failed to create controller",
  "controller": "authconfigstatusupdate",
  "error": "controller with name authconfig already exists. Controller names must be unique to avoid multiple controllers reporting the same metric. This validation can be disabled via the SkipNameValidation option"
}

Solution

Explicitly set the controller name to "authconfigstatus" using the .Named() builder method in AuthConfigStatusUpdater.SetupWithManager() to ensure uniqueness.

References

Summary by CodeRabbit

  • Chores
    • Assigned an explicit name to the authentication configuration status controller for clearer identification.

Controller-runtime v0.19+ validates that all controllers registered with
the same manager have unique names. The AuthConfigStatusUpdater was
implicitly getting the name "authconfig" from the logger hierarchy, which
conflicted with the main AuthConfigReconciler.

Explicitly set the controller name to "authconfigstatus" using the Named()
builder method to ensure uniqueness.

Fixes the error: "controller with name authconfig already exists"

Signed-off-by: Michael Nairn <mnairn@redhat.com>
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 975007d1-61c1-4e90-b5fe-a450834c2248

📥 Commits

Reviewing files that changed from the base of the PR and between 0966088 and ec8874d.

📒 Files selected for processing (1)
  • controllers/auth_config_status_updater.go

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

SetupWithManager now assigns the controller the explicit name authconfigstatus.

Changes

Controller Naming

Layer / File(s) Summary
Assign explicit controller name
controllers/auth_config_status_updater.go
SetupWithManager passes authconfigstatus when constructing the controller.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to ec887

The controller naming change addresses the startup collision without introducing an identified runtime or integration risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarises the main change: assigning a unique controller name to the AuthConfig status updater. It is concise and specific.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the controller name
authconfigstatus now leads the game
SetupWithManager sets it clear
One small change brings order here
Hop by hop, the setup is done

Comment @coderabbitai help to get the list of available commands.

@mikenairn
mikenairn added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit d0636b9 Sep 18, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from Ready For Review to Done in Kuadrant Sep 18, 2026
@mikenairn
mikenairn deleted the fix_controller_name_validation_issue branch September 18, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants