Skip to content

Frontend Blocker: Storage Pools and Snapshot pages broken due to Headlamp v0.39 CRD rendering crash#4342

Open
datacore-gjanoti wants to merge 1 commit intokubernetes-sigs:mainfrom
datacore-gjanoti:fix/crd-getMainAPIGroup-crash-4301
Open

Frontend Blocker: Storage Pools and Snapshot pages broken due to Headlamp v0.39 CRD rendering crash#4342
datacore-gjanoti wants to merge 1 commit intokubernetes-sigs:mainfrom
datacore-gjanoti:fix/crd-getMainAPIGroup-crash-4301

Conversation

@datacore-gjanoti
Copy link

@datacore-gjanoti datacore-gjanoti commented Jan 8, 2026

This PR is wrt to fix the following issue - #4301

Headlamp v0.39 is crashing when rendering CreateResourceButton for some CRDs
because getMainAPIGroup() is called on an undefined CRD reference.

This PR adds a safe fallback to derive apiVersion without crashing.
The change is minimal and backward-compatible.

Tested locally with v0.39:

  • Storage Pools
  • Volume Snapshots
  • Snapshot Classes

Root Cause Analysis -

CreateResourceButton

ResourceListView

KubeObjectClass.getBaseObject()

makeCustomResourceClass()

customResourceDefinition.getMainAPIGroup() ❌ (was breaking)

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 8, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: datacore-gjanoti / name: Gaurav Janoti (9d2254b)

@k8s-ci-robot
Copy link
Contributor

Welcome @datacore-gjanoti!

It looks like this is your first PR to kubernetes-sigs/headlamp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/headlamp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: datacore-gjanoti
Once this PR has been reviewed and has the lgtm label, please assign joaquimrocha for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 8, 2026
@datacore-gjanoti datacore-gjanoti changed the title Fix crash when CRD metadata is undefined in getBaseObject Blocker Issue - Fix crash when CRD metadata is undefined in getBaseObject Jan 16, 2026
@datacore-gjanoti datacore-gjanoti changed the title Blocker Issue - Fix crash when CRD metadata is undefined in getBaseObject Blocker: Storage Pools and Snapshot pages broken due to Headlamp v0.39 CRD rendering crash Jan 16, 2026
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 30, 2026
@datacore-gjanoti datacore-gjanoti force-pushed the fix/crd-getMainAPIGroup-crash-4301 branch from 6eab1e0 to 52ec2e7 Compare January 30, 2026 09:35
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 30, 2026
@illume illume requested a review from Copilot January 30, 2026 10:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a Headlamp v0.39 crash when rendering CRD-backed resource pages by preventing getMainAPIGroup() from being called on an invalid/undefined CRD reference during base-object creation.

Changes:

  • Adds a guarded path in makeCustomResourceClass().getBaseObject() to derive apiVersion from the CRD only when it’s present and has getMainAPIGroup().
  • Adds a safe fallback to derive apiVersion from the class’ apiVersion when the CRD reference is missing/invalid.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wfclark5
Copy link

++ @ashu8912

Copy link
Contributor

@illume illume 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 this.

Please check the git commit guidelines in the contributing docs, and look at other git messages with git log to see how they should be formatted.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@datacore-gjanoti datacore-gjanoti changed the title Blocker: Storage Pools and Snapshot pages broken due to Headlamp v0.39 CRD rendering crash Frontend Blocker: Storage Pools and Snapshot pages broken due to Headlamp v0.39 CRD rendering crash Feb 2, 2026
@illume illume requested a review from Copilot February 4, 2026 11:52
@illume
Copy link
Contributor

illume commented Feb 4, 2026

Thanks.

Can you please have a look at changing the git commit message? Also please squash the commits, and rebase against main to remove the merge commit?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@datacore-gjanoti datacore-gjanoti force-pushed the fix/crd-getMainAPIGroup-crash-4301 branch from 19189de to 9effb94 Compare February 5, 2026 08:31
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 5, 2026
@datacore-gjanoti datacore-gjanoti force-pushed the fix/crd-getMainAPIGroup-crash-4301 branch from 9effb94 to d557665 Compare February 5, 2026 08:43
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 5, 2026
@datacore-gjanoti
Copy link
Author

@illume - Thanks for guiding, now I have only one commit (as per Headlamp contribution guidelines)

@datacore-gjanoti
Copy link
Author

@illume @ashu8912 please review the PR, I have done the suggested changes.

@datacore-gjanoti datacore-gjanoti force-pushed the fix/crd-getMainAPIGroup-crash-4301 branch from d557665 to b1c7641 Compare February 12, 2026 09:58
@datacore-gjanoti
Copy link
Author

Rebased on latest upstream/main and force-pushed. The branch is now based on bd7b6ab.
The previous digest verification failure was due to the branch being behind upstream.
Could someone please re-run the CI jobs? @illume @ashu8912

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2026
Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

Hello again. Sorry, there’s a conflict now… can you please have a look?

@datacore-gjanoti datacore-gjanoti force-pushed the fix/crd-getMainAPIGroup-crash-4301 branch from b1c7641 to 9d2254b Compare February 16, 2026 09:55
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 16, 2026
@datacore-gjanoti
Copy link
Author

@illume @ashu8912 - Rebased on latest upstream/main and resolved the conflicts. Ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants