Frontend Blocker: Storage Pools and Snapshot pages broken due to Headlamp v0.39 CRD rendering crash#4342
Conversation
|
|
|
Welcome @datacore-gjanoti! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: datacore-gjanoti The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
6eab1e0 to
52ec2e7
Compare
There was a problem hiding this comment.
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 deriveapiVersionfrom the CRD only when it’s present and hasgetMainAPIGroup(). - Adds a safe fallback to derive
apiVersionfrom the class’apiVersionwhen the CRD reference is missing/invalid.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
++ @ashu8912 |
illume
left a comment
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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? |
There was a problem hiding this comment.
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.
19189de to
9effb94
Compare
9effb94 to
d557665
Compare
|
@illume - Thanks for guiding, now I have only one commit (as per Headlamp contribution guidelines) |
d557665 to
b1c7641
Compare
illume
left a comment
There was a problem hiding this comment.
Hello again. Sorry, there’s a conflict now… can you please have a look?
b1c7641 to
9d2254b
Compare
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:
Root Cause Analysis -
CreateResourceButton
↓
ResourceListView
↓
KubeObjectClass.getBaseObject()
↓
makeCustomResourceClass()
↓
customResourceDefinition.getMainAPIGroup() ❌ (was breaking)