Skip to content

Conversation

@hardikdr
Copy link
Member

@hardikdr hardikdr commented Jan 26, 2026

Proposed Changes

Fixes #

Summary by CodeRabbit

  • New Features

    • Added bootPolicy to ServerClaim with options None, NetworkBootOnce (default), NetworkBootAlways.
    • Added configurable first-boot conditions flag to control initial boot behavior.
  • Documentation

    • Updated API reference and concepts guide with boot policy details and examples.
  • Tests

    • Added comprehensive tests covering PXE boot decision logic across policies and first-boot scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@hardikdr hardikdr requested a review from a team as a code owner January 26, 2026 09:18
@github-actions github-actions bot added size/L documentation Improvements or additions to documentation labels Jan 26, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 26, 2026

Walkthrough

Adds a BootPolicy enum and bootPolicy field to ServerClaim; propagates a first-boot-conditions CLI flag into the manager; updates controller logic to consult boot configuration and first-boot conditions when deciding PXE boot; updates CRD schema and docs; adds tests for PXE decision logic.

Changes

Cohort / File(s) Summary
API Types
api/v1alpha1/serverclaim_types.go
Adds type BootPolicy string and constants BootPolicyNone, BootPolicyNetworkBootOnce, BootPolicyNetworkBootAlways; adds BootPolicy BootPolicy \json:"bootPolicy,omitempty"`toServerClaimSpecwith defaultNetworkBootOnce`.
CRD Schema
config/crd/bases/metal.ironcore.dev_serverclaims.yaml
Adds spec.properties.bootPolicy entry with type: string, enum: [None, NetworkBootOnce, NetworkBootAlways], and default: NetworkBootOnce.
Manager Configuration
cmd/manager/main.go
Adds --first-boot-conditions flag (default: IgnitionDataFetched,IPXEScriptFetched), parsing helper splitAndTrimList, and passes parsed FirstBootConditions into ServerReconciler.
Server Controller Logic
internal/controller/server_controller.go
Adds FirstBootConditions []string to ServerReconciler; changes serverBootConfigurationIsReady to return (*ServerBootConfiguration, bool, error); adds shouldPXEBootServer(...) and bootConfigHasFirstBootCondition(...); updates PXE boot/power decision flow and logging to consider boot policy and first-boot conditions.
Controller Tests
internal/controller/server_controller_test.go
Adds shouldPXEBootServer test suite covering BootPolicyNetworkBootAlways, NetworkBootOnce, None, empty policy, and combinations of first-boot conditions; duplicate test block appears in diff.
API Documentation
docs/api-reference/api.md
Documents new BootPolicy type and bootPolicy field in ServerClaimSpec with allowed values and default.
Concept Documentation
docs/concepts/serverclaims.md
Adds "Boot Policies" section describing NetworkBootOnce, NetworkBootAlways, and None behaviors and reconciliation implications.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Manager
participant ServerReconciler
participant ServerClaim
participant ServerBootConfig
participant BMC as BMC/PXE
Manager->>ServerReconciler: start (FirstBootConditions configured)
ServerReconciler->>ServerClaim: fetch ServerClaim
ServerReconciler->>ServerBootConfig: fetch ServerBootConfiguration
ServerReconciler->>ServerReconciler: shouldPXEBootServer(claim, bootConfig, FirstBootConditions)
alt decision = PXE boot
ServerReconciler->>BMC: configure PXE boot & power on
BMC-->>ServerReconciler: power state updates
else decision = do not PXE boot
ServerReconciler->>BMC: ensure configured per policy / no PXE changes
end
ServerReconciler->>ServerClaim: update status / phase

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete, containing only placeholder bullet points and no actual details about the changes, rationale, or linked issues despite the template requiring specific information. Complete the description by adding at least 2-3 bullet points explaining the changes made, such as new BootPolicy API field, controller integration, and updated boot logic, and reference the related issue number.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: implementing BootPolicy API handling in ServerClaim, which aligns with the actual changes across type definitions, CRD, controller logic, and documentation.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@hardikdr hardikdr force-pushed the enh/add-serverclaim-bootpolicy-api branch from 650a1f2 to 7f2fd56 Compare January 26, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change area/metal-automation do-not-merge documentation Improvements or additions to documentation enhancement New feature or request size/L

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants