Skip to content

metal3: Add Metal3Data, Metal3DataClaim, and Metal3DataTemplate views#900

Draft
mastermaxx03 wants to merge 6 commits into
headlamp-k8s:mainfrom
mastermaxx03:metal3-data
Draft

metal3: Add Metal3Data, Metal3DataClaim, and Metal3DataTemplate views#900
mastermaxx03 wants to merge 6 commits into
headlamp-k8s:mainfrom
mastermaxx03:metal3-data

Conversation

@mastermaxx03

@mastermaxx03 mastermaxx03 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Stacked on #899 (which is stacked on #892).

Summary

Continues the Metal3 plugin. Adds Metal3Data, Metal3DataClaim, and Metal3DataTemplate to the Metal3 section, the CAPM3 resources that render and hand out per-node metadata and network data on bare metal. More resources and a map view to follow.

Included

  • Metal3Data list and detail views with Ready state, index, template and claim links, and error.
  • Metal3DataClaim list and detail views with the rendered-data reference.
  • Metal3DataTemplate list and detail views with cluster name and metadata.
  • The Metal3 sidebar group extended with the three new entries.

How to test

  • A cluster with the Metal3 and CAPM3 CRDs installed.
  • cd metal3 && npm install && npm start, then run Headlamp.
  • Apply the sample: kubectl apply -f metal3/test-files/metal3data.yaml.
  • Open the Metal3 section: the data, data claims, and data templates lists, and clicking one opens the detail view.

@mastermaxx03

Copy link
Copy Markdown
Contributor Author

@Rozzii would like your input!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR continues the Metal3 Headlamp plugin by expanding the Metal3 section with additional Cluster API Provider Metal3 (CAPM3) resource views and wiring them into the plugin’s sidebar/routes, plus sample manifests for local testing.

Changes:

  • Add list/detail views for Metal3Data, Metal3DataClaim, and Metal3DataTemplate resources (v1beta2) guarded by CRD presence.
  • Add list/detail views for Metal3Machine/Metal3MachineTemplate and Metal3Cluster/Metal3ClusterTemplate resources (v1beta2), including a hostSelector formatter with unit tests.
  • Extend the Metal3 sidebar group and register routes for all of the above, plus new sample YAMLs under metal3/test-files/.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
metal3/src/index.tsx Registers the Metal3 sidebar group plus routes/entries for machines, clusters, and data resources.
metal3/src/Metal3Machine/List.tsx Adds Metal3Machine list view with provisioned/providerID/cluster columns.
metal3/src/Metal3Machine/Details.tsx Adds Metal3Machine detail view showing provisioned, provider ID, image, and host annotation.
metal3/src/Metal3MachineTemplate/List.tsx Adds Metal3MachineTemplate list view including hostSelector formatting.
metal3/src/Metal3MachineTemplate/Details.tsx Adds Metal3MachineTemplate detail view (host selector, node reuse, image, cleaning mode, data template).
metal3/src/Metal3MachineTemplate/hostSelector.ts Implements formatHostSelector for a readable selector summary.
metal3/src/Metal3MachineTemplate/hostSelector.test.ts Unit tests for formatHostSelector.
metal3/src/Metal3Cluster/List.tsx Adds Metal3Cluster list view with provisioned, endpoint, and cluster columns.
metal3/src/Metal3Cluster/Details.tsx Adds Metal3Cluster detail view with endpoint and cloud provider flag.
metal3/src/Metal3ClusterTemplate/List.tsx Adds Metal3ClusterTemplate list view with cloud provider enabled column.
metal3/src/Metal3ClusterTemplate/Details.tsx Adds Metal3ClusterTemplate detail view showing cloud provider enabled.
metal3/src/Metal3Data/List.tsx Adds Metal3Data list view with Ready and Index columns.
metal3/src/Metal3Data/Details.tsx Adds Metal3Data detail view showing Ready, Index, Template, Claim, and Error.
metal3/src/Metal3DataClaim/List.tsx Adds Metal3DataClaim list view showing renderedData reference.
metal3/src/Metal3DataClaim/Details.tsx Adds Metal3DataClaim detail view showing template/renderedData/error.
metal3/src/Metal3DataTemplate/List.tsx Adds Metal3DataTemplate list view showing clusterName.
metal3/src/Metal3DataTemplate/Details.tsx Adds Metal3DataTemplate detail view showing clusterName and metadata entry count.
metal3/test-files/metal3machine.yaml Adds sample Metal3Machine + Metal3MachineTemplate manifest.
metal3/test-files/metal3cluster.yaml Adds sample Metal3Cluster + Metal3ClusterTemplate manifest.
metal3/test-files/metal3data.yaml Adds sample Metal3DataTemplate + Metal3DataClaim + Metal3Data manifest.

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

Comment on lines +44 to +45
dataTemplate:
name: sample-metadata
* limitations under the License.
*/

import { DetailsGrid } from '@kinvolk/headlamp-plugin/lib/CommonComponents';
Comment on lines +59 to +62
{
name: 'Template',
value: item.jsonData.spec?.template?.name || '-',
},
Comment on lines +63 to +66
{
name: 'Claim',
value: item.jsonData.spec?.claim?.name || '-',
},

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 20 out of 20 changed files in this pull request and generated 1 comment.

Comment on lines +69 to +75
{
id: 'index',
label: 'Index',
getValue: (d: KubeObject) =>
d.jsonData.spec?.index === undefined ? '-' : String(d.jsonData.spec.index),
},
'age',
@mastermaxx03 mastermaxx03 force-pushed the metal3-data branch 2 times, most recently from 65f50e7 to f82ae17 Compare July 14, 2026 17:24
…iews

Signed-off-by: mastermaxx03 <srivastavaanimesh22@gmail.com>
…ies and routes

Signed-off-by: mastermaxx03 <srivastavaanimesh22@gmail.com>
Signed-off-by: mastermaxx03 <srivastavaanimesh22@gmail.com>
…and detail views

Signed-off-by: mastermaxx03 <srivastavaanimesh22@gmail.com>
…sidebar entries and routes

Signed-off-by: mastermaxx03 <srivastavaanimesh22@gmail.com>
Signed-off-by: mastermaxx03 <srivastavaanimesh22@gmail.com>
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.

2 participants