-
Notifications
You must be signed in to change notification settings - Fork 10
Add BMCSettings type and controller implementation
#303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
74804ce
Add crd and controller for BMCSettings
nagadeesh-nagaraja 4e23cb7
change name to bmcSettings
nagadeesh-nagaraja 34f2c5b
Add reset bmc, improve controller logic
nagadeesh-nagaraja 71cf437
skip some lint check temporarily
nagadeesh-nagaraja f131000
Improve documentation for bmcSettings
nagadeesh-nagaraja 23d1414
Update design to accomodate difference vedor variations
nagadeesh-nagaraja 6e8e476
merge conflict after rebase
nagadeesh-nagaraja 00baa72
request for maintenance all the time
nagadeesh-nagaraja 4aea0b4
Merge with latest Unit test helpers
nagadeesh-nagaraja 851b693
expected merge changes with BIOSVersion CRD PR
nagadeesh-nagaraja 0182085
Fix naming convenctions, factor out code and fix comments
nagadeesh-nagaraja e5343e4
Use requeAfter instead of reconcile error
nagadeesh-nagaraja ba84abc
Resolve merge conflicts with main
nagadeesh-nagaraja 3468544
Change naming to ServerMaintenanceRefItem
nagadeesh-nagaraja 13a1421
Merge branch 'main' into bmcSetting
nagadeesh-nagaraja 9ffd502
resolve merge conflict with merge
nagadeesh-nagaraja d6f055f
regenerate genereted files
nagadeesh-nagaraja 19fe67d
some code improvements
nagadeesh-nagaraja 0ad0a39
remove unwanted comments and newlines
nagadeesh-nagaraja 3019d87
Add webhook for `BMCSettings` resources (#322)
nagadeesh-nagaraja eddad77
Update the serverMaintenanceRef API field
nagadeesh-nagaraja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| // SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package v1alpha1 | ||
|
|
||
| import ( | ||
| corev1 "k8s.io/api/core/v1" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // BMCSettings refer's to Out-Of-Band_management like IDrac for Dell, iLo for HPE etc Settings | ||
|
|
||
| // BMCSettingsSpec defines the desired state of BMCSettings. | ||
| type BMCSettingsSpec struct { | ||
| // Version contains BMC version this settings applies to | ||
| // +required | ||
| Version string `json:"version"` | ||
|
|
||
| // SettingsMap contains bmc settings as map | ||
| // +optional | ||
| SettingsMap map[string]string `json:"settings,omitempty"` | ||
|
|
||
| // BMCRef is a reference to a specific BMC to apply setting to. | ||
| // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverRef is immutable" | ||
| BMCRef *corev1.LocalObjectReference `json:"BMCRef,omitempty"` | ||
|
|
||
| // ServerMaintenancePolicy is maintenance policy to be enforced on the server when applying setting. | ||
| // ServerMaintenancePolicyOwnerApproval is asking for User approval for changing BMC settings | ||
| // note: User approval is only enforced for server's which are reserved state | ||
| // ServerMaintenancePolicyEnforced will will bypass user approval and apply setting directly | ||
| ServerMaintenancePolicy ServerMaintenancePolicy `json:"serverMaintenancePolicy,omitempty"` | ||
|
|
||
| // ServerMaintenanceRefs are references to a ServerMaintenance objects that Controller has requested for the each of the related server. | ||
| ServerMaintenanceRefs []ServerMaintenanceRefItem `json:"serverMaintenanceRefs,omitempty"` | ||
| } | ||
|
|
||
| type ServerMaintenanceRefItem struct { | ||
nagadeesh-nagaraja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ServerMaintenanceRef *corev1.ObjectReference `json:"serverMaintenanceRef,omitempty"` | ||
| } | ||
|
|
||
| // ServerMaintenanceState specifies the current state of the server maintenance. | ||
| type BMCSettingsState string | ||
|
|
||
| const ( | ||
| // BMCSettingsStatePending specifies that the BMC maintenance is waiting | ||
| BMCSettingsStatePending BMCSettingsState = "Pending" | ||
| // BMCSettingsStateInProgress specifies that the BMC setting changes are in progress | ||
| BMCSettingsStateInProgress BMCSettingsState = "InProgress" | ||
| // BMCSettingsStateApplied specifies that the BMC maintenance has been completed. | ||
| BMCSettingsStateApplied BMCSettingsState = "Applied" | ||
| // BMCSettingsStateFailed specifies that the BMC maintenance has failed. | ||
| BMCSettingsStateFailed BMCSettingsState = "Failed" | ||
| ) | ||
|
|
||
| // BMCSettingsStatus defines the observed state of BMCSettings. | ||
| type BMCSettingsStatus struct { | ||
| // State represents the current state of the BMC configuration task. | ||
| State BMCSettingsState `json:"state,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:resource:scope=Cluster | ||
| // +kubebuilder:printcolumn:name="BMCVersion",type=string,JSONPath=`.spec.bmcSettings.version` | ||
| // +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state` | ||
| // +kubebuilder:printcolumn:name="BMCRef",type=string,JSONPath=`.spec.BMCRef.name` | ||
| // +kubebuilder:printcolumn:name="ServerRef",type=string,JSONPath=`.spec.serverRef.name` | ||
|
|
||
| // BMCSettings is the Schema for the BMCSettings API. | ||
| type BMCSettings struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec BMCSettingsSpec `json:"spec,omitempty"` | ||
| Status BMCSettingsStatus `json:"status,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
||
| // BMCSettingsList contains a list of BMCSettings. | ||
| type BMCSettingsList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []BMCSettings `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| SchemeBuilder.Register(&BMCSettings{}, &BMCSettingsList{}) | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.