Skip to content

Commit 6390b3f

Browse files
Improve documentation for bmcSettings
1 parent 8f1ebe3 commit 6390b3f

File tree

8 files changed

+142
-170
lines changed

8 files changed

+142
-170
lines changed

api/v1alpha1/bmcsettings_types.go

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,39 @@ import (
1313
// BMCSettingsSpec defines the desired state of BMCSettings.
1414
type BMCSettingsSpec struct {
1515

16-
// BMCSettings specifies the BMC settings for the selected serverRef's Out-of-Band-Management
17-
BMCSettings BMCSettingsMap `json:"bmcSettings,omitempty"`
16+
// BMCSettingsSpec specifies the BMC settings for the selected serverRef's Out-of-Band-Management
17+
BMCSettingsSpec Settings `json:"bmcSettingsSpec,omitempty"`
1818

1919
// ServerRef is a reference to a specific server's Manager to apply setting to.
2020
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverRef is immutable"
2121
ServerRefList []*corev1.LocalObjectReference `json:"serverRefList,omitempty"`
2222

2323
// BMCRef is a reference to a specific BMC to apply setting to.
24+
// ServerRef is ignored if BMCRef is set
2425
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverRef is immutable"
2526
BMCRef *corev1.LocalObjectReference `json:"BMCRef,omitempty"`
2627

2728
// ServerMaintenancePolicy is maintenance policy to be enforced on the server when applying setting.
28-
// ServerMaintenancePolicyOwnerApproval is asking for human approval if bmc reboot is needed
29+
// ServerMaintenancePolicyOwnerApproval is asking for User approval for changing BMC settings
30+
// note: User approval is only enforced for server's which are reserved state
2931
// ServerMaintenancePolicyEnforced will not create a maintenance request even if bmc reboot is needed.
30-
ServerMaintenancePolicy ServerMaintenancePolicy `json:"serverMaintenancePolicy,omitempty"`
32+
ServerMaintenancePolicyType ServerMaintenancePolicy `json:"serverMaintenancePolicyType,omitempty"`
3133

32-
// ServerMaintenanceRef is a reference to a ServerMaintenance object that that BMC has requested for the referred server.
33-
ServerMaintenanceRefMap map[string]*corev1.ObjectReference `json:"serverMaintenanceRefList,omitempty"`
34-
}
35-
36-
type BMCSettingsMap struct {
37-
// Version contains BMC version
38-
// +required
39-
Version string `json:"version"`
40-
41-
// Settings contains BMC settings as map
42-
// +optional
43-
Settings map[string]string `json:"settings,omitempty"`
34+
// ServerMaintenanceRefMap are references to a ServerMaintenance objects that Controller has requested for the each of the related server.
35+
ServerMaintenanceRefMap map[string]*corev1.ObjectReference `json:"serverMaintenanceRefMap,omitempty"`
4436
}
4537

4638
// ServerMaintenanceState specifies the current state of the server maintenance.
4739
type BMCSettingsState string
4840

4941
const (
50-
// BMCSettingsStateInVersionUpgrade specifies that the server BMC is in version upgrade path.
42+
// BMCSettingsStatePending specifies that the BMC maintenance is waiting
5143
BMCSettingsStatePending BMCSettingsState = "Pending"
52-
// BMCSettingsStateInProgress specifies that the server BMC is in setting update path.
44+
// BMCSettingsStateInProgress specifies that the BMC setting changes are in progress
5345
BMCSettingsStateInProgress BMCSettingsState = "InProgress"
54-
// BMCSettingsStateApplied specifies that the server BMC maintenance has been completed.
46+
// BMCSettingsStateApplied specifies that the BMC maintenance has been completed.
5547
BMCSettingsStateApplied BMCSettingsState = "Applied"
56-
// BMCSettingsStateFailed specifies that the server maintenance has failed.
48+
// BMCSettingsStateFailed specifies that the BMC maintenance has failed.
5749
BMCSettingsStateFailed BMCSettingsState = "Failed"
5850
)
5951

@@ -66,6 +58,10 @@ type BMCSettingsStatus struct {
6658
// +kubebuilder:object:root=true
6759
// +kubebuilder:subresource:status
6860
// +kubebuilder:resource:scope=Cluster
61+
// +kubebuilder:printcolumn:name="BMCVersion",type=string,JSONPath=`.spec.bmcSettings.version`
62+
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
63+
// +kubebuilder:printcolumn:name="BMCRef",type=string,JSONPath=`.spec.BMCRef.name`
64+
// +kubebuilder:printcolumn:name="ServerRef",type=string,JSONPath=`.spec.serverRef.name`
6965

7066
// BMCSettings is the Schema for the BMCSettings API.
7167
type BMCSettings struct {

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/metal.ironcore.dev_bmcsettings.yaml

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,20 @@ spec:
1414
singular: bmcsettings
1515
scope: Cluster
1616
versions:
17-
- name: v1alpha1
17+
- additionalPrinterColumns:
18+
- jsonPath: .spec.bmcSettings.version
19+
name: BMCVersion
20+
type: string
21+
- jsonPath: .status.state
22+
name: State
23+
type: string
24+
- jsonPath: .spec.BMCRef.name
25+
name: BMCRef
26+
type: string
27+
- jsonPath: .spec.serverRef.name
28+
name: ServerRef
29+
type: string
30+
name: v1alpha1
1831
schema:
1932
openAPIV3Schema:
2033
description: BMCSettings is the Schema for the BMCSettings API.
@@ -40,8 +53,9 @@ spec:
4053
description: BMCSettingsSpec defines the desired state of BMCSettings.
4154
properties:
4255
BMCRef:
43-
description: BMCRef is a reference to a specific BMC to apply setting
44-
to.
56+
description: |-
57+
BMCRef is a reference to a specific BMC to apply setting to.
58+
ServerRef is ignored if BMCRef is set
4559
properties:
4660
name:
4761
default: ""
@@ -57,28 +71,30 @@ spec:
5771
x-kubernetes-validations:
5872
- message: serverRef is immutable
5973
rule: self == oldSelf
60-
bmcSettings:
61-
description: BMCSettings specifies the BMC settings for the selected
74+
bmcSettingsSpec:
75+
description: BMCSettingsSpec specifies the BMC settings for the selected
6276
serverRef's Out-of-Band-Management
6377
properties:
6478
settings:
6579
additionalProperties:
6680
type: string
67-
description: Settings contains BMC settings as map
81+
description: SettingsMap contains bios settings as map
6882
type: object
6983
version:
70-
description: Version contains BMC version
84+
description: Version contains BIOS version this settings applies
85+
to
7186
type: string
7287
required:
7388
- version
7489
type: object
75-
serverMaintenancePolicy:
76-
description: |-
77-
ServerMaintenancePolicy is maintenance policy to be enforced on the server when applying setting.
78-
ServerMaintenancePolicyOwnerApproval is asking for human approval if bmc reboot is needed
79-
ServerMaintenancePolicyEnforced will not create a maintenance request even if bmc reboot is needed.
90+
serverMaintenancePolicyType:
91+
description: "ServerMaintenancePolicy is maintenance policy to be
92+
enforced on the server when applying setting.\nServerMaintenancePolicyOwnerApproval
93+
is asking for User approval for changing BMC settings\n\tnote: User
94+
approval is only enforced for server's which are reserved state\nServerMaintenancePolicyEnforced
95+
will not create a maintenance request even if bmc reboot is needed."
8096
type: string
81-
serverMaintenanceRefList:
97+
serverMaintenanceRefMap:
8298
additionalProperties:
8399
description: ObjectReference contains enough information to let
84100
you inspect or modify the referred object.
@@ -123,8 +139,9 @@ spec:
123139
type: string
124140
type: object
125141
x-kubernetes-map-type: atomic
126-
description: ServerMaintenanceRef is a reference to a ServerMaintenance
127-
object that that BMC has requested for the referred server.
142+
description: ServerMaintenanceRefMap are references to a ServerMaintenance
143+
objects that Controller has requested for the each of the related
144+
server.
128145
type: object
129146
serverRefList:
130147
description: ServerRef is a reference to a specific server's Manager

config/samples/metal_v1alpha1_bmcsettings.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ metadata:
88
spec:
99
serverRef:
1010
name: endpoint-sample-system-0
11-
bmcSettings:
11+
bmcSettingsSpec:
1212
version: 7.00.00.171
1313
settings:
1414
ThermalSettings.1.FanSpeedOffset: "3"
15-
ServerMaintenancePolicyTemplate: Enforced
15+
serverMaintenancePolicyType: Enforced

dist/chart/templates/crd/metal.ironcore.dev_bmcsettings.yaml

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,20 @@ spec:
2020
singular: bmcsettings
2121
scope: Cluster
2222
versions:
23-
- name: v1alpha1
23+
- additionalPrinterColumns:
24+
- jsonPath: .spec.bmcSettings.version
25+
name: BMCVersion
26+
type: string
27+
- jsonPath: .status.state
28+
name: State
29+
type: string
30+
- jsonPath: .spec.BMCRef.name
31+
name: BMCRef
32+
type: string
33+
- jsonPath: .spec.serverRef.name
34+
name: ServerRef
35+
type: string
36+
name: v1alpha1
2437
schema:
2538
openAPIV3Schema:
2639
description: BMCSettings is the Schema for the BMCSettings API.
@@ -46,8 +59,9 @@ spec:
4659
description: BMCSettingsSpec defines the desired state of BMCSettings.
4760
properties:
4861
BMCRef:
49-
description: BMCRef is a reference to a specific BMC to apply setting
50-
to.
62+
description: |-
63+
BMCRef is a reference to a specific BMC to apply setting to.
64+
ServerRef is ignored if BMCRef is set
5165
properties:
5266
name:
5367
default: ""
@@ -63,28 +77,30 @@ spec:
6377
x-kubernetes-validations:
6478
- message: serverRef is immutable
6579
rule: self == oldSelf
66-
bmcSettings:
67-
description: BMCSettings specifies the BMC settings for the selected
80+
bmcSettingsSpec:
81+
description: BMCSettingsSpec specifies the BMC settings for the selected
6882
serverRef's Out-of-Band-Management
6983
properties:
7084
settings:
7185
additionalProperties:
7286
type: string
73-
description: Settings contains BMC settings as map
87+
description: SettingsMap contains bios settings as map
7488
type: object
7589
version:
76-
description: Version contains BMC version
90+
description: Version contains BIOS version this settings applies
91+
to
7792
type: string
7893
required:
7994
- version
8095
type: object
81-
serverMaintenancePolicy:
82-
description: |-
83-
ServerMaintenancePolicy is maintenance policy to be enforced on the server when applying setting.
84-
ServerMaintenancePolicyOwnerApproval is asking for human approval if bmc reboot is needed
85-
ServerMaintenancePolicyEnforced will not create a maintenance request even if bmc reboot is needed.
96+
serverMaintenancePolicyType:
97+
description: "ServerMaintenancePolicy is maintenance policy to be
98+
enforced on the server when applying setting.\nServerMaintenancePolicyOwnerApproval
99+
is asking for User approval for changing BMC settings\n\tnote: User
100+
approval is only enforced for server's which are reserved state\nServerMaintenancePolicyEnforced
101+
will not create a maintenance request even if bmc reboot is needed."
86102
type: string
87-
serverMaintenanceRefList:
103+
serverMaintenanceRefMap:
88104
additionalProperties:
89105
description: ObjectReference contains enough information to let
90106
you inspect or modify the referred object.
@@ -129,8 +145,9 @@ spec:
129145
type: string
130146
type: object
131147
x-kubernetes-map-type: atomic
132-
description: ServerMaintenanceRef is a reference to a ServerMaintenance
133-
object that that BMC has requested for the referred server.
148+
description: ServerMaintenanceRefMap are references to a ServerMaintenance
149+
objects that Controller has requested for the each of the related
150+
server.
134151
type: object
135152
serverRefList:
136153
description: ServerRef is a reference to a specific server's Manager

0 commit comments

Comments
 (0)