metal3: Link BareMetalHost and Metal3Machine details to each other#902
Open
mastermaxx03 wants to merge 1 commit into
Open
metal3: Link BareMetalHost and Metal3Machine details to each other#902mastermaxx03 wants to merge 1 commit into
mastermaxx03 wants to merge 1 commit into
Conversation
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Adds cross-navigation between Metal3 resources in the Headlamp Metal3 plugin so users can quickly jump between a BareMetalHost and the Metal3Machine that consumes/claims it (and vice versa), reducing manual copy/search workflows. This PR also includes the stacked Metal3Machine/Metal3MachineTemplate views and supporting helpers/tests needed for the navigation to be usable end-to-end.
Changes:
- Link
BareMetalHost.spec.consumerRefto theMetal3Machinedetail view when the consumer kind isMetal3Machine. - Link
Metal3Machinedetail view back to its claimedBareMetalHostby parsing themetal3.io/BareMetalHostannotation (namespace/name), with unit tests. - Add Metal3MachineTemplate list/detail views (including a formatted
hostSelectorsummary + tests), expand Metal3 sidebar/routes, and include sample YAML for local testing.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| metal3/src/BareMetalHost/Details.tsx | Makes the Consumer field clickable when it references a Metal3Machine. |
| metal3/src/Metal3Machine/Details.tsx | Adds a BareMetalHost field that links to the claimed host when the annotation parses as namespace/name. |
| metal3/src/Metal3Machine/hostAnnotation.ts | Introduces HOST_ANNOTATION constant and parseHostAnnotation helper used by the detail link logic. |
| metal3/src/Metal3Machine/hostAnnotation.test.ts | Unit tests for parseHostAnnotation parsing/validation behavior. |
| metal3/src/index.tsx | Registers sidebar entries and routes for Metal3Machines and Metal3MachineTemplates; updates baremetalhosts route sidebar key. |
| metal3/src/Metal3Machine/List.tsx | Adds Metal3Machine list view with provisioned/providerID/cluster columns. |
| metal3/src/Metal3MachineTemplate/List.tsx | Adds Metal3MachineTemplate list view including formatted hostSelector and other key columns. |
| metal3/src/Metal3MachineTemplate/Details.tsx | Adds Metal3MachineTemplate detail view with key blueprint fields. |
| metal3/src/Metal3MachineTemplate/hostSelector.ts | Adds formatHostSelector helper for a stable, readable selector summary. |
| metal3/src/Metal3MachineTemplate/hostSelector.test.ts | Unit tests for formatHostSelector. |
| metal3/test-files/metal3machine.yaml | Adds sample Metal3Machine/Metal3MachineTemplate objects demonstrating the host annotation and template fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: mastermaxx03 <srivastavaanimesh22@gmail.com>
045cbc8 to
b6f7c49
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the link between a BareMetalHost and its Metal3Machine clickable in the detail views. A host is consumed by a machine, and the machine records which host it claimed, so this lets you click straight from one to the other instead of copying a name and searching for it. First piece of the resource chain.
Included
How to test