Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/v1alpha1/server_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ type ServerStatus struct {
// +optional
State ServerState `json:"state,omitempty"`

// NetworkCheck indicates the network configuration validation status.
// Possible values: "Pass" (all interfaces match Netbox), "Fail" (mismatches detected), "Unknown" (not yet validated).
// +kubebuilder:validation:Enum=Pass;Fail;Unknown
// +kubebuilder:default=Unknown
// +optional
NetworkCheck string `json:"networkCheck,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Who exactly should react on changes to that field? Also this looks like something which is better kept in the status.conditions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's like a flag to check after buildup, reconfiguration. It will also be present in greenhouse/prometheus.

I agree that status.conditions is a better place.

Copy link
Member

Choose a reason for hiding this comment

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

What we are doing on our side is setting lables/annotations indicating that the Server is ready for consumption.

Copy link
Member

Choose a reason for hiding this comment

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

An idiomatic way of doing things like that would be e.g.:

Your controller which talks to netbox writes:

my-operator.io/network-validation-result: success

Then the ServerReconciler could populate e.g. the conditions slice with a corresponding Condition.

Alternatively we can define a dedicated substruct in the status for that e.g.:

status:
  state: Available
  conditions:
    - type: Ready
      # ... other fields ...

  # Managed by some external component
  networkConnectivity:
    status: "Unknown"  # "Ready", "Failure", "Checking"
    lastUpdateTime: "2025-12-10T12:00:00Z"
    message: "Awaiting connectivity check from external service."

The external component should have only PATCH RBAC permissions on the Server resources.


// NetworkInterfaces is a list of network interfaces associated with the server.
// +optional
NetworkInterfaces []NetworkInterface `json:"networkInterfaces,omitempty"`
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/metal.ironcore.dev_servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,16 @@ spec:
model:
description: Model is the model of the server.
type: string
networkCheck:
default: Unknown
description: |-
NetworkCheck indicates the network configuration validation status.
Possible values: "Pass" (all interfaces match Netbox), "Fail" (mismatches detected), "Unknown" (not yet validated).
enum:
- Pass
- Fail
- Unknown
type: string
networkInterfaces:
description: NetworkInterfaces is a list of network interfaces associated
with the server.
Expand Down
Loading