Skip to content

build: repopulate TypeMeta after client.Get to avoid event recorder nil deref#6601

Closed
SAY-5 wants to merge 1 commit into
apache:mainfrom
SAY-5:say5/build-controller-typemeta-6587
Closed

build: repopulate TypeMeta after client.Get to avoid event recorder nil deref#6601
SAY-5 wants to merge 1 commit into
apache:mainfrom
SAY-5:say5/build-controller-typemeta-6587

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 2, 2026

Fixes #6587.

After PR #6492 migrated the build controller from record.EventRecorder to events.EventRecorder, every event publish went through reference.GetReference(scheme, obj) which calls obj.GetObjectKind(). controller-runtime strips TypeMeta from objects returned by client.Get (kubernetes-sigs/controller-runtime#1735), so GetObjectKind() nil-derefs and the build controller panics on every reconcile.

Repopulate TypeMeta immediately after client.Get returns. The same pattern likely affects the pipe, integration, integrationkit, integrationplatform, and catalog controllers (all migrated to events.EventRecorder); happy to send a sibling PR if you'd like the sweep, but filing Build alone first per the issue scope.

…il deref

Signed-off-by: SAY-5 <say.apm35@gmail.com>
Copy link
Copy Markdown
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking at it. We have already discussed the solution in #6589 - this particular case is likely going to affect also the other controllers. We'll fix it bringing back the object specific event funcs.

@SAY-5
Copy link
Copy Markdown
Author

SAY-5 commented May 6, 2026

Closing in favor of #6589 — thanks @squakez!

@SAY-5 SAY-5 closed this May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build controller panics with nil pointer dereference on every build in 2.10.0

2 participants