Documentation ¶
Overview ¶
(C) Copyright [2022] Hewlett Packard Enterprise Development LP
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func CaseInsensitiveContains(s string) (string, bool)
- func CompareArray(arr1, arr2 []string) bool
- func CompareMaps(m1, m2 map[string]string) (bool, map[string]string)
- func ContainsValue(elems []string, v string) bool
- func ConvertInterfaceToStringArray(items []interface{}) []string
- func ConvertToArray(data []interface{}) []string
- func DecryptWithPrivateKey(ctx context.Context, cipherText string, privKey rsa.PrivateKey, ...) string
- func EncryptWithPublicKey(ctx context.Context, secretMessage string, key rsa.PublicKey) string
- func ExportRsaPrivateKeyAsPemStr(privkey *rsa.PrivateKey) string
- func ExportRsaPublicKeyAsPemStr(pubkey *rsa.PublicKey) (string, error)
- func GetHostPort(ctx context.Context, uri string) (string, string, error)
- func IgnoreStatusUpdate() predicate.Predicate
- func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error)
- func ParseRsaPublicKeyFromPemStr(pubPEM string) (*rsa.PublicKey, error)
- func RemoveSpecialChar(str string) string
- type CommonReconciler
- func (r *CommonReconciler) CheckAndCreateBiosSchemaObject(ctx context.Context, attributeResp map[string]interface{}, ...) bool
- func (r *CommonReconciler) CheckAndCreateEventMessageObject(ctx context.Context, messageRegistryResp map[string]interface{}, ...) bool
- func (r *CommonReconciler) CreateBiosSettingObject(ctx context.Context, biosAttributes map[string]string, bmcObj *infraiov1.Bmc) bool
- func (r *CommonReconciler) CreateBootOrderSettingObject(ctx context.Context, bootAttributes *infraiov1.BootSetting, ...) bool
- func (r *CommonReconciler) CreateEventSubscriptionObject(ctx context.Context, subscriptionDetails map[string]interface{}, ns string, ...) bool
- func (r *CommonReconciler) DeleteBmcObject(ctx context.Context, bmcObj *infraiov1.Bmc)
- func (r *CommonReconciler) DeleteVolumeObject(ctx context.Context, volObj *infraiov1.Volume)
- func (r *CommonReconciler) GetAllBiosSchemaRegistryObjects(ctx context.Context, ns string) *[]infraiov1.BiosSchemaRegistry
- func (r *CommonReconciler) GetAllBmcObject(ctx context.Context, ns string) *[]infraiov1.Bmc
- func (r *CommonReconciler) GetAllEventSubscriptionObjects(ctx context.Context, ns string) *[]infraiov1.Eventsubscription
- func (r *CommonReconciler) GetAllVolumeObjectIds(ctx context.Context, bmc *infraiov1.Bmc, ns string) map[string][]string
- func (r *CommonReconciler) GetAllVolumeObjects(ctx context.Context, bmcIP, ns string) []*infraiov1.Volume
- func (r *CommonReconciler) GetBiosObject(ctx context.Context, field, value, ns string) *infraiov1.BiosSetting
- func (r *CommonReconciler) GetBiosSchemaObject(ctx context.Context, field, value, ns string) *infraiov1.BiosSchemaRegistry
- func (r *CommonReconciler) GetBmcObject(ctx context.Context, field, value, ns string) *infraiov1.Bmc
- func (r *CommonReconciler) GetBootObject(ctx context.Context, field, value, ns string) *infraiov1.BootOrderSetting
- func (c *CommonReconciler) GetCommonReconcilerClient() client.Client
- func (c *CommonReconciler) GetCommonReconcilerScheme() *runtime.Scheme
- func (r *CommonReconciler) GetEventMessageRegistryObject(ctx context.Context, field, value, ns string) *infraiov1.EventsMessageRegistry
- func (r *CommonReconciler) GetEventSubscriptionObjectName(ctx context.Context, destination, name, ns string) string
- func (r *CommonReconciler) GetEventsubscriptionObject(ctx context.Context, field, value, ns string) *infraiov1.Eventsubscription
- func (r *CommonReconciler) GetFirmwareObject(ctx context.Context, field, value, ns string) *infraiov1.Firmware
- func (r *CommonReconciler) GetObjectSecret(ctx context.Context, secret *corev1.Secret, secretName, rootdir string) (string, string, string)
- func (r *CommonReconciler) GetOdimObject(ctx context.Context, field, value, ns string) *infraiov1.Odim
- func (r *CommonReconciler) GetUpdatedBmcObject(ctx context.Context, ns types.NamespacedName, bmcObj *infraiov1.Bmc)
- func (r *CommonReconciler) GetUpdatedEventsubscriptionObjects(ctx context.Context, ns types.NamespacedName, ...)
- func (r *CommonReconciler) GetUpdatedFirmwareObject(ctx context.Context, ns types.NamespacedName, firmObj *infraiov1.Firmware)
- func (r *CommonReconciler) GetUpdatedOdimObject(ctx context.Context, ns types.NamespacedName, odimObj *infraiov1.Odim)
- func (r *CommonReconciler) GetUpdatedVolumeObject(ctx context.Context, ns types.NamespacedName, volObj *infraiov1.Volume)
- func (r *CommonReconciler) GetVolumeObject(ctx context.Context, bmcIP, ns string) *infraiov1.Volume
- func (r *CommonReconciler) GetVolumeObjectByVolumeID(ctx context.Context, volumeID, ns string) *infraiov1.Volume
- func (r *CommonReconciler) UpdateBiosSettingObject(ctx context.Context, biosAttributes map[string]string, ...) bool
- func (r *CommonReconciler) UpdateBmcObjectOnReset(ctx context.Context, bmcObject *infraiov1.Bmc, status string)
- func (r *CommonReconciler) UpdateBmcStatus(ctx context.Context, bmcObj *infraiov1.Bmc)
- func (r *CommonReconciler) UpdateEventsubscriptionStatus(ctx context.Context, eventsubObj *infraiov1.Eventsubscription, ...)
- func (r *CommonReconciler) UpdateOdimStatus(ctx context.Context, status string, odimObj *infraiov1.Odim)
- func (r *CommonReconciler) UpdateVolumeStatus(ctx context.Context, volObject *infraiov1.Volume, ...)
- type ReconcilerInterface
Constants ¶
This section is empty.
Variables ¶
var ( // PrivateKey holds the value for PrivateKey PrivateKey *rsa.PrivateKey // PublicKey holds the value for PublicKey PublicKey *rsa.PublicKey // RootCA contains the RootCA value RootCA []byte )
var ( // MuxLock is used for avoiding race conditions MuxLock = &sync.Mutex{} )
Functions ¶
func CaseInsensitiveContains ¶
CaseInsensitiveContains used to check if vendor is available
func CompareArray ¶
CompareArray is used to compare two arrays
func CompareMaps ¶
CompareMaps function compares values of two maps and return true if equal else returns false
func ContainsValue ¶
ContainsValue checks if array contains the string value
func ConvertInterfaceToStringArray ¶
func ConvertInterfaceToStringArray(items []interface{}) []string
ConvertInterfaceToStringArray will convert and return an array of interface into array of string
func ConvertToArray ¶
func ConvertToArray(data []interface{}) []string
ConvertToArray is used to convert interface to array of string
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(ctx context.Context, cipherText string, privKey rsa.PrivateKey, doBase64Decode bool) string
Decryption
func EncryptWithPublicKey ¶
Encryption with OAEP padding
func ExportRsaPrivateKeyAsPemStr ¶
func ExportRsaPrivateKeyAsPemStr(privkey *rsa.PrivateKey) string
func GetHostPort ¶
getHostPort returns host,port of odim
func IgnoreStatusUpdate ¶
ignoreStatusUpdate ignores reconcile when status/metadata is updated
func ParseRsaPrivateKeyFromPemStr ¶
func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error)
func RemoveSpecialChar ¶
RemoveSpecialChar used to remove special char from ID to get bios object name
Types ¶
type CommonReconciler ¶
func (*CommonReconciler) CheckAndCreateBiosSchemaObject ¶
func (r *CommonReconciler) CheckAndCreateBiosSchemaObject(ctx context.Context, attributeResp map[string]interface{}, bmcObj *infraiov1.Bmc) bool
CheckAndCreateBiosSchemaObject verifies if bios schema object is available else create it
func (*CommonReconciler) CheckAndCreateEventMessageObject ¶
func (r *CommonReconciler) CheckAndCreateEventMessageObject(ctx context.Context, messageRegistryResp map[string]interface{}, bmcObj *infraiov1.Bmc) bool
CheckAndCreateEventMessageObject checks if the message registry object already exist, if not then the object is created
func (*CommonReconciler) CreateBiosSettingObject ¶
func (r *CommonReconciler) CreateBiosSettingObject(ctx context.Context, biosAttributes map[string]string, bmcObj *infraiov1.Bmc) bool
createBiosSettingObject is used for creating bios setting object with same name and namespace as of bmc
func (*CommonReconciler) CreateBootOrderSettingObject ¶
func (r *CommonReconciler) CreateBootOrderSettingObject(ctx context.Context, bootAttributes *infraiov1.BootSetting, bmcObj *infraiov1.Bmc) bool
CreateBootOrderSettingObject is used for creating boot order object with same name and namespace as of bmc
func (*CommonReconciler) CreateEventSubscriptionObject ¶
func (r *CommonReconciler) CreateEventSubscriptionObject(ctx context.Context, subscriptionDetails map[string]interface{}, ns string, originResources []string) bool
CreateEventSubscriptionObject creates an eventsubscription object in system
func (*CommonReconciler) DeleteBmcObject ¶
func (r *CommonReconciler) DeleteBmcObject(ctx context.Context, bmcObj *infraiov1.Bmc)
DeleteBmcObject will delete the bmc object from operator
func (*CommonReconciler) DeleteVolumeObject ¶
func (r *CommonReconciler) DeleteVolumeObject(ctx context.Context, volObj *infraiov1.Volume)
DeleteVolumeObject will delete the volume object from operator
func (*CommonReconciler) GetAllBiosSchemaRegistryObjects ¶
func (r *CommonReconciler) GetAllBiosSchemaRegistryObjects(ctx context.Context, ns string) *[]infraiov1.BiosSchemaRegistry
GetAllBiosSchemaRegistryObjects will get all the bios schema registry objects
func (*CommonReconciler) GetAllBmcObject ¶
GetAllBmcObject is used to get all bmc object details based on given namespace
func (*CommonReconciler) GetAllEventSubscriptionObjects ¶
func (r *CommonReconciler) GetAllEventSubscriptionObjects(ctx context.Context, ns string) *[]infraiov1.Eventsubscription
GetAllEventSubscriptionObjects will return all the event subscription objects present in BMC operator under the requested namespace
func (*CommonReconciler) GetAllVolumeObjectIds ¶
func (r *CommonReconciler) GetAllVolumeObjectIds(ctx context.Context, bmc *infraiov1.Bmc, ns string) map[string][]string
GetAllVolumeObjectIds will get all the volume ids of specific bmc volume objects
func (*CommonReconciler) GetAllVolumeObjects ¶
func (*CommonReconciler) GetBiosObject ¶
func (r *CommonReconciler) GetBiosObject(ctx context.Context, field, value, ns string) *infraiov1.BiosSetting
GetBiosObject is used to get bios object details based on given field and value
func (*CommonReconciler) GetBiosSchemaObject ¶
func (r *CommonReconciler) GetBiosSchemaObject(ctx context.Context, field, value, ns string) *infraiov1.BiosSchemaRegistry
GetBiosSchemaObject is used to get bios schema object details based on given field and value
func (*CommonReconciler) GetBmcObject ¶
func (r *CommonReconciler) GetBmcObject(ctx context.Context, field, value, ns string) *infraiov1.Bmc
----------------------------GET OBJECTS--------------------------------- GetBmcObject is used to get bmc object details based on given field and value
func (*CommonReconciler) GetBootObject ¶
func (r *CommonReconciler) GetBootObject(ctx context.Context, field, value, ns string) *infraiov1.BootOrderSetting
GetBootObject is used to get bios object details based on given field and value
func (*CommonReconciler) GetCommonReconcilerClient ¶
func (c *CommonReconciler) GetCommonReconcilerClient() client.Client
func (*CommonReconciler) GetCommonReconcilerScheme ¶
func (c *CommonReconciler) GetCommonReconcilerScheme() *runtime.Scheme
func (*CommonReconciler) GetEventMessageRegistryObject ¶
func (r *CommonReconciler) GetEventMessageRegistryObject(ctx context.Context, field, value, ns string) *infraiov1.EventsMessageRegistry
GetEventMessageRegistryObject fetch eventsmessageregistry object based on fields and values passed
func (*CommonReconciler) GetEventSubscriptionObjectName ¶
func (r *CommonReconciler) GetEventSubscriptionObjectName(ctx context.Context, destination, name, ns string) string
GetEventSubscriptionObjectName will parse and return eventsubscription object name which will be supported by metadata.name
func (*CommonReconciler) GetEventsubscriptionObject ¶
func (r *CommonReconciler) GetEventsubscriptionObject(ctx context.Context, field, value, ns string) *infraiov1.Eventsubscription
GetEventsubscriptionObject will fetch the event subscription present in BMC operator based on the field and value and return the first object
func (*CommonReconciler) GetFirmwareObject ¶
func (r *CommonReconciler) GetFirmwareObject(ctx context.Context, field, value, ns string) *infraiov1.Firmware
GetFirmwareObject will fetch and return a firmware object based on the field and value
func (*CommonReconciler) GetObjectSecret ¶
func (r *CommonReconciler) GetObjectSecret(ctx context.Context, secret *corev1.Secret, secretName, rootdir string) (string, string, string)
-----------------------------GET OBJECT DETAILS-------------------------- getSecret returns the username,password,authenticationType for a particular secret
func (*CommonReconciler) GetOdimObject ¶
func (*CommonReconciler) GetUpdatedBmcObject ¶
func (r *CommonReconciler) GetUpdatedBmcObject(ctx context.Context, ns types.NamespacedName, bmcObj *infraiov1.Bmc)
---------------------------------GET UPDATED OBJECT----------------------------------- getUpdatedBmcObject used to get updated BMC object
func (*CommonReconciler) GetUpdatedEventsubscriptionObjects ¶
func (r *CommonReconciler) GetUpdatedEventsubscriptionObjects(ctx context.Context, ns types.NamespacedName, eventSubObj *infraiov1.Eventsubscription)
GetUpdatedEventsubscriptionObjects used to get updated BMC object
func (*CommonReconciler) GetUpdatedFirmwareObject ¶
func (r *CommonReconciler) GetUpdatedFirmwareObject(ctx context.Context, ns types.NamespacedName, firmObj *infraiov1.Firmware)
GetUpdatedFirmwareObject used to get updated BMC object
func (*CommonReconciler) GetUpdatedOdimObject ¶
func (r *CommonReconciler) GetUpdatedOdimObject(ctx context.Context, ns types.NamespacedName, odimObj *infraiov1.Odim)
GetUpdatedOdimObject gets the updated Odim object
func (*CommonReconciler) GetUpdatedVolumeObject ¶
func (r *CommonReconciler) GetUpdatedVolumeObject(ctx context.Context, ns types.NamespacedName, volObj *infraiov1.Volume)
GetUpdatedVolumeObject used to get updated BMC object
func (*CommonReconciler) GetVolumeObject ¶
func (*CommonReconciler) GetVolumeObjectByVolumeID ¶
func (r *CommonReconciler) GetVolumeObjectByVolumeID(ctx context.Context, volumeID, ns string) *infraiov1.Volume
GetVolumeObjectByVolumeID will fetch and return volume object based on volumeID
func (*CommonReconciler) UpdateBiosSettingObject ¶
func (r *CommonReconciler) UpdateBiosSettingObject(ctx context.Context, biosAttributes map[string]string, biosObj *infraiov1.BiosSetting) bool
----------------------------------------UPDATE OBJECT STATUS--------------------------------------- UpdateBiosSettingObject used to update the bios object
func (*CommonReconciler) UpdateBmcObjectOnReset ¶
func (r *CommonReconciler) UpdateBmcObjectOnReset(ctx context.Context, bmcObject *infraiov1.Bmc, status string)
UpdateBmcObjectOnReset updates the systemReset field in bmc object
func (*CommonReconciler) UpdateBmcStatus ¶
func (r *CommonReconciler) UpdateBmcStatus(ctx context.Context, bmcObj *infraiov1.Bmc)
UpdateBmcStatus used to update the bmc object
func (*CommonReconciler) UpdateEventsubscriptionStatus ¶
func (r *CommonReconciler) UpdateEventsubscriptionStatus(ctx context.Context, eventsubObj *infraiov1.Eventsubscription, eventsubscriptionDetails map[string]interface{}, originResources []string)
UpdateEventsubscriptionStatus will update the status of event subscription object
func (*CommonReconciler) UpdateOdimStatus ¶
func (r *CommonReconciler) UpdateOdimStatus(ctx context.Context, status string, odimObj *infraiov1.Odim)
UpdateOdimStatus updates the status of odim object under status field
func (*CommonReconciler) UpdateVolumeStatus ¶
func (r *CommonReconciler) UpdateVolumeStatus(ctx context.Context, volObject *infraiov1.Volume, volumeID, volumeName, capBytes, durableName, durableNameFormat string)
UpdateVolumeStatus updates the volume object status
type ReconcilerInterface ¶
type ReconcilerInterface interface { //get objects GetBmcObject(ctx context.Context, field, value, ns string) *infraiov1.Bmc GetAllBmcObject(ctx context.Context, ns string) *[]infraiov1.Bmc GetBiosSchemaObject(ctx context.Context, field, value, ns string) *infraiov1.BiosSchemaRegistry GetBiosObject(ctx context.Context, field, value, ns string) *infraiov1.BiosSetting GetBootObject(ctx context.Context, field, value, ns string) *infraiov1.BootOrderSetting GetOdimObject(ctx context.Context, field, value, ns string) *infraiov1.Odim GetVolumeObject(ctx context.Context, bmcIP, ns string) *infraiov1.Volume GetAllVolumeObjects(ctx context.Context, bmcIP, ns string) []*infraiov1.Volume GetVolumeObjectByVolumeID(ctx context.Context, volumeID, ns string) *infraiov1.Volume GetEventsubscriptionObject(ctx context.Context, field, value, ns string) *infraiov1.Eventsubscription GetAllEventSubscriptionObjects(ctx context.Context, ns string) *[]infraiov1.Eventsubscription GetAllBiosSchemaRegistryObjects(ctx context.Context, ns string) *[]infraiov1.BiosSchemaRegistry //get attributes of objects GetAllVolumeObjectIds(ctx context.Context, bmc *infraiov1.Bmc, ns string) map[string][]string GetFirmwareObject(ctx context.Context, field, value, ns string) *infraiov1.Firmware GetEventMessageRegistryObject(ctx context.Context, field, value, ns string) *infraiov1.EventsMessageRegistry //create objects CreateBiosSettingObject(ctx context.Context, biosAttributes map[string]string, bmcObj *infraiov1.Bmc) bool CreateBootOrderSettingObject(ctx context.Context, bootAttributes *infraiov1.BootSetting, bmcObj *infraiov1.Bmc) bool CheckAndCreateBiosSchemaObject(ctx context.Context, attributeResp map[string]interface{}, bmcObj *infraiov1.Bmc) bool CreateEventSubscriptionObject(ctx context.Context, subscriptionDetails map[string]interface{}, ns string, originResources []string) bool CheckAndCreateEventMessageObject(ctx context.Context, messageRegistryResp map[string]interface{}, bmcObj *infraiov1.Bmc) bool //update objects UpdateBiosSettingObject(ctx context.Context, biosAttributes map[string]string, bmcObj *infraiov1.BiosSetting) bool UpdateBmcStatus(ctx context.Context, bmcObj *infraiov1.Bmc) UpdateOdimStatus(ctx context.Context, status string, odimObj *infraiov1.Odim) UpdateBmcObjectOnReset(ctx context.Context, bmcObject *infraiov1.Bmc, status string) UpdateVolumeStatus(ctx context.Context, volObject *infraiov1.Volume, volumeID, volumeName, capBytes, durableName, durableNameFormat string) UpdateEventsubscriptionStatus(ctx context.Context, eventsubObj *infraiov1.Eventsubscription, eventsubscriptionDetails map[string]interface{}, originResouces []string) //get updated objects GetUpdatedBmcObject(ctx context.Context, ns types.NamespacedName, bmcObj *infraiov1.Bmc) GetUpdatedOdimObject(ctx context.Context, ns types.NamespacedName, odimObj *infraiov1.Odim) GetUpdatedVolumeObject(ctx context.Context, ns types.NamespacedName, volObj *infraiov1.Volume) //delete objects DeleteBmcObject(ctx context.Context, bmcObj *infraiov1.Bmc) DeleteVolumeObject(ctx context.Context, volObj *infraiov1.Volume) GetUpdatedFirmwareObject(ctx context.Context, ns types.NamespacedName, firmObj *infraiov1.Firmware) GetUpdatedEventsubscriptionObjects(ctx context.Context, ns types.NamespacedName, eventSubObj *infraiov1.Eventsubscription) //common reconciler funcs GetCommonReconcilerClient() client.Client GetCommonReconcilerScheme() *runtime.Scheme }
func GetCommonReconciler ¶
func GetCommonReconciler(c client.Client, s *runtime.Scheme) ReconcilerInterface
GetCommonReconciler will return common Reconciler object