Skip to content

Add short names to metal resources#679

Merged
afritzler merged 2 commits intomainfrom
chore/shortnames
Feb 17, 2026
Merged

Add short names to metal resources#679
afritzler merged 2 commits intomainfrom
chore/shortnames

Conversation

@afritzler
Copy link
Member

@afritzler afritzler commented Feb 16, 2026

Summary by CodeRabbit

  • New Features

    • Many CRDs gain short-name aliases for easier CLI use.
    • Server maintenance policy field exposed across BIOS/BMC/version/settings resources.
    • BIOS settings can target servers via a server selector.
    • BMCUser status now shows ID, last rotation, and password expiration; BMC/Bios version types add Completed/Failed states and rename image secret ref to SecretRef (printer column → UpdatePolicy).
  • Documentation

    • Numerous API and field descriptions refined for clarity and consistency.
  • Schema

    • BMCSettings CRD now requires version.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Walkthrough

Adds several new public fields (e.g., ServerMaintenancePolicy, ServerSelector, BMCUserStatus fields), many CRD shortNames, small CRD schema adjustments (descriptions, a few required/validation entries), and widespread comment/description standardization across API types and CRD manifests.

Changes

Cohort / File(s) Summary
BIOS API Types
api/v1alpha1/biossettings_types.go, api/v1alpha1/biossettingsset_types.go, api/v1alpha1/biosversion_types.go, api/v1alpha1/biosversionset_types.go
Added ServerMaintenancePolicy to BIOSSettingsTemplate and BIOSVersionTemplate; added ServerSelector to BIOSSettingsSetSpec; updated kubebuilder shortName annotations and standardized comments/print-column name changes.
BMC API Types
api/v1alpha1/bmc_types.go, api/v1alpha1/bmcsecret_types.go, api/v1alpha1/bmcsettings_types.go, api/v1alpha1/bmcsettingsset_types.go, api/v1alpha1/bmcuser_types.go, api/v1alpha1/bmcversion_types.go, api/v1alpha1/bmcversionset_types.go
Added ServerMaintenancePolicy to BMCSettingsTemplate/BMCVersionTemplate; added LastRotation, PasswordExpiration, ID to BMCUserStatus; added BMCVersionState values; introduced/updated kubebuilder shortNames and printer columns; mostly doc and annotation changes.
Server & Infra API Types
api/v1alpha1/server_types.go, api/v1alpha1/serverbootconfiguration_types.go, api/v1alpha1/serverclaim_types.go, api/v1alpha1/servermaintenance_types.go, api/v1alpha1/endpoint_types.go
Added shortName annotations (srv, sbc, scl, sm, mep); removed/streamlined optionality wording and simplified inline comments (documentation-only edits).
CRD: BIOS manifests
config/crd/bases/metal.ironcore.dev_biossettings.yaml, config/crd/bases/metal.ironcore.dev_biossettingssets.yaml, config/crd/bases/metal.ironcore.dev_biosversions.yaml, config/crd/bases/metal.ironcore.dev_biosversionsets.yaml
Added CRD shortNames (bioss, biosss, biosv, biosvs); added serverMaintenancePolicy to BIOSVersionSpec; renamed print column updateTypeupdatePolicy; standardized OpenAPI descriptions.
CRD: BMC manifests
config/crd/bases/metal.ironcore.dev_bmcs.yaml, config/crd/bases/metal.ironcore.dev_bmcsettings.yaml, config/crd/bases/metal.ironcore.dev_bmcsettingssets.yaml, config/crd/bases/metal.ironcore.dev_bmcusers.yaml, config/crd/bases/metal.ironcore.dev_bmcversions.yaml, config/crd/bases/metal.ironcore.dev_bmcversionsets.yaml
Added shortNames (bmcsec, bmcu, bmcv, bmcvs); added/adjusted OpenAPI descriptions and printer columns (UpdatePolicy); added immutability validations and added version to required in BMCSettings CRD; added status/printer columns for BMCUser.
CRD: Server & Infra manifests
config/crd/bases/metal.ironcore.dev_endpoints.yaml, config/crd/bases/metal.ironcore.dev_serverbootconfigurations.yaml, config/crd/bases/metal.ironcore.dev_serverclaims.yaml, config/crd/bases/metal.ironcore.dev_servermaintenances.yaml, config/crd/bases/metal.ironcore.dev_servers.yaml
Added CRD shortNames (mep, sbc, scl, sm, srv); simplified OpenAPI descriptions and removed optionality boilerplate (doc-only changes).
API Reference Documentation
docs/api-reference/api.md
Large-scale wording, capitalization, and description standardization across API reference docs; no signature or behavioral changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • davidgrun
  • nagadeesh-nagaraja
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is missing. The template requires at least 'Proposed Changes' and 'Fixes' sections, but the author provided no description at all. Add a description following the repository template, including proposed changes summary and any related issue numbers.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change: adding short names to metal resources. This is clearly reflected across multiple files where shortNames fields are added to CRD definitions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/shortnames

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@api/v1alpha1/biossettingsset_types.go`:
- Line 38: Two CRDs share the same kubebuilder shortName "bmcs" (BMCSettings and
BMCSecret), causing a collision; pick one (either the BMCSettings type in
bmcsettings_types.go / type BMCSettings or the BMCSecret type in
bmcsecret_types.go / type BMCSecret) and change its kubebuilder:resource
shortName to a unique value (e.g., "bmcsec" or similar) so it no longer
conflicts, updating the +kubebuilder:resource:scope=... annotation for that type
and regenerating CRD manifests so the new shortName is applied consistently
(note BiossettingsSet already uses "bss" and can remain unchanged).

In `@api/v1alpha1/bmcsettings_types.go`:
- Line 78: The CRD shortName collision between BMCSettings and BMCSecret (both
using shortName=bmcs) will break CRD registration; update the
kubebuilder:resource annotations to use distinct short names (e.g., change the
annotation on the BMCSettings type declaration in
api/v1alpha1/bmcsettings_types.go to shortName=bmcset and change the annotation
on the BMCSecret type declaration in api/v1alpha1/bmcsecret_types.go to
shortName=bmcsec), then regenerate CRDs/manifests so the new unique short names
take effect.

In `@api/v1alpha1/bmcversion_types.go`:
- Line 74: The printcolumn annotation references a non-existent field
`.spec.updateType`; update it to reference the actual spec field by changing the
kubebuilder printcolumn JSONPath to `.spec.updatePolicy` to match the
BMCVersionSpec's UpdatePolicy (JSON tag `updatePolicy`) so the column shows the
correct value; locate the annotation line with the comment `//
+kubebuilder:printcolumn:name="updateType"...` and update the JSONPath/name as
appropriate to reflect `updatePolicy`.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 16, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
config/crd/bases/metal.ironcore.dev_bmcsettingssets.yaml (1)

1-175: ⚠️ Potential issue | 🟡 Minor

Add shortNames to BMCSettingsSet and other BMC-related CRDs for consistency.

BMCSettingsSet lacks a shortNames field, inconsistent with BIOSSettings, BIOSSettingsSet, ServerMaintenance, and other CRDs in the codebase. Additionally, BMCSettings and BMCs CRDs also lack shortNames. Consider adding short name aliases across all BMC-related resources (e.g., bmcss for BMCSettingsSet, bmcs for BMCSettings, etc.) to match the established pattern throughout the API group.

🧹 Nitpick comments (1)
config/crd/bases/metal.ironcore.dev_biosversions.yaml (1)

100-103: Add enum validation for serverMaintenancePolicy in the Go types.

This field accepts exactly two stable values (OwnerApproval and Enforced), which are already defined as constants in api/v1alpha1/servermaintenance_types.go. Adding a +kubebuilder:validation:Enum marker on the ServerMaintenancePolicy type definition would enforce valid values at admission time and align with similar patterns already used in the codebase (e.g., ProtocolName in bmc_types.go). This would catch invalid policy values early rather than allowing arbitrary strings.

@afritzler
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
api/v1alpha1/bmcsettingsset_types.go (1)

37-39: ⚠️ Potential issue | 🟠 Major

Add missing shortName for BMCSettingsSet.

The PR's objective is to add short names to metal resources. The sibling BIOSSettingsSet has shortName=bss, and BMCSettingsSet should have a corresponding short name. Note that BMCSettings is also missing a short name and should be addressed similarly.

Suggested fix
-// +kubebuilder:resource:scope=Cluster
+// +kubebuilder:resource:scope=Cluster,shortName=bmcss
config/crd/bases/metal.ironcore.dev_bmcsettings.yaml (1)

122-125: ⚠️ Potential issue | 🟡 Minor

Adding version to required is a validation tightening — verify no existing resources omit it.

Previously only BMCRef was required. Adding version to the required list means existing BMCSettings resources that lack a version field will now fail validation on create/update. While this is acceptable for an alpha API, confirm that all existing consumers already set this field.

#!/bin/bash
# Check if version was previously required or if this is a new addition
git diff HEAD~1 -- config/crd/bases/metal.ironcore.dev_bmcsettings.yaml | grep -A5 -B5 'required'
🧹 Nitpick comments (1)
api/v1alpha1/bmcsettingsset_types.go (1)

13-14: Pre-existing: +required marker contradicts omitempty JSON tag.

BMCSettingsTemplate is marked +required but the JSON tag includes omitempty, which tells the serializer to drop the field when zero-valued. For required fields the convention is to omit omitempty. This is pre-existing and not introduced by this PR, but worth cleaning up.

@afritzler afritzler added enhancement New feature or request and removed chore labels Feb 17, 2026
@afritzler
Copy link
Member Author

@coderabbitai summary

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

✅ Actions performed

Summary regeneration triggered.

@afritzler afritzler merged commit 8e79110 into main Feb 17, 2026
19 checks passed
@afritzler afritzler deleted the chore/shortnames branch February 17, 2026 15:41
@github-project-automation github-project-automation bot moved this to Done in Roadmap Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change area/metal-automation documentation Improvements or additions to documentation enhancement New feature or request size/XL

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants