diff --git a/go.mod b/go.mod index 59d7babd8c1..a0d76407a32 100644 --- a/go.mod +++ b/go.mod @@ -191,9 +191,9 @@ require ( // OpenShift Forks replace ( - github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20211201170610-92ffa60c683d - github.com/metal3-io/baremetal-operator/apis => github.com/openshift/baremetal-operator/apis v0.0.0-20211201170610-92ffa60c683d - github.com/metal3-io/baremetal-operator/pkg/hardwareutils => github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20211201170610-92ffa60c683d + github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20220128094204-28771f489634 + github.com/metal3-io/baremetal-operator/apis => github.com/openshift/baremetal-operator/apis v0.0.0-20220128094204-28771f489634 + github.com/metal3-io/baremetal-operator/pkg/hardwareutils => github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20220128094204-28771f489634 sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210121023454-5ffc5f422a80 sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20210626224711-5d94c794092f // Indirect dependency through MAO from cluster API providers sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20211111204942-611d320170af diff --git a/go.sum b/go.sum index 7cab61a7e02..6af05cdef47 100644 --- a/go.sum +++ b/go.sum @@ -791,9 +791,9 @@ github.com/googleapis/gnostic v0.5.4/go.mod h1:TRWw1s4gxBGjSe301Dai3c7wXJAZy57+/ github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gophercloud/gophercloud v0.15.1-0.20210202035223-633d73521055/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= -github.com/gophercloud/gophercloud v0.18.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= github.com/gophercloud/gophercloud v0.19.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= github.com/gophercloud/gophercloud v0.20.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= +github.com/gophercloud/gophercloud v0.22.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= github.com/gophercloud/gophercloud v0.24.0 h1:jDsIMGJ1KZpAjYfQgGI2coNQj5Q83oPzuiGJRFWgMzw= github.com/gophercloud/gophercloud v0.24.0/go.mod h1:Q8fZtyi5zZxPS/j9aj3sSxtvj41AdQMDwyo1myduD5c= github.com/gophercloud/utils v0.0.0-20210720165645-8a3ad2ad9e70/go.mod h1:wx8HMD8oQD0Ryhz6+6ykq75PJ79iPyEqYHfwZ4l7OsA= @@ -1194,12 +1194,12 @@ github.com/openshift/api v0.0.0-20211217221424-8779abfbd571/go.mod h1:F/eU6jgr6Q github.com/openshift/api v0.0.0-20220204103739-31ffd77a8f02/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= github.com/openshift/api v0.0.0-20220325173635-8107b7a38e53 h1:WpOfczPbuY5llRH94DJRsGTsgm7d8iAA2b7m0+YXAqI= github.com/openshift/api v0.0.0-20220325173635-8107b7a38e53/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= -github.com/openshift/baremetal-operator v0.0.0-20211201170610-92ffa60c683d h1:4KkYItiWENIs2bV6lKOcIMdWUnZJA+GWT9Us7z0P1UA= -github.com/openshift/baremetal-operator v0.0.0-20211201170610-92ffa60c683d/go.mod h1:p32F1DBUxfgd0JjM4rCuhJomFJokEoWR1Z/LZNL2LM8= -github.com/openshift/baremetal-operator/apis v0.0.0-20211201170610-92ffa60c683d h1:DHGXCvXWsPExutf3tgQYD4TVDSAOviLXO7Vnc42oXhw= -github.com/openshift/baremetal-operator/apis v0.0.0-20211201170610-92ffa60c683d/go.mod h1:CVSU+wS3oYrFJooMeiyDtTpatoXoKyXPE2YS5vT26vE= -github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20211201170610-92ffa60c683d h1:ldAAKEQlOoIp8nqCnHyhVH5pMvgepP8gmN6Ve12ai7I= -github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20211201170610-92ffa60c683d/go.mod h1:Q+r+xTc1jDcx/y61bVspJ9ANiAjJlsx/j+sL44mCB8w= +github.com/openshift/baremetal-operator v0.0.0-20220128094204-28771f489634 h1:HMxwhxQKSamgM3RpvbUwUKrnD39fEAWrEYaueTHVRmY= +github.com/openshift/baremetal-operator v0.0.0-20220128094204-28771f489634/go.mod h1:fKoRJ8B07os5e+LFLvhFSS2g8nTODZW/J5jKw4dsQ18= +github.com/openshift/baremetal-operator/apis v0.0.0-20220128094204-28771f489634 h1:TfLz0GbuVWt0bKNK+71JeYHIAemjcnE1fAVgqMgw2Ac= +github.com/openshift/baremetal-operator/apis v0.0.0-20220128094204-28771f489634/go.mod h1:bTFE2qR9PJJQbLC6Gd74c3WXcgYnR1njVDgabCxXQNI= +github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20220128094204-28771f489634 h1:sGL5yvlRTpCVM2Ck47Tn09PPSgSTLq2V+B2nSNkBDIs= +github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20220128094204-28771f489634/go.mod h1:/PSTQInIZmfuOmAp/pSgZAs4txs6T49woC0MYIa4QzE= github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= @@ -1945,6 +1945,7 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+R golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalhost_validation.go b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalhost_validation.go index d8eda14246c..f9843e39dea 100644 --- a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalhost_validation.go +++ b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalhost_validation.go @@ -2,7 +2,9 @@ package v1alpha1 import ( "fmt" + "regexp" + "github.com/google/uuid" logf "sigs.k8s.io/controller-runtime/pkg/log" _ "github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc" @@ -20,6 +22,10 @@ func (host *BareMetalHost) validateHost() []error { errs = append(errs, err) } + if err := validateBMHName(host.Name); err != nil { + errs = append(errs, err) + } + return errs } @@ -55,3 +61,18 @@ func validateRAID(r *RAIDConfig) error { return nil } + +func validateBMHName(bmhname string) error { + + invalidname, _ := regexp.MatchString(`[^A-Za-z0-9\.\-\_]`, bmhname) + if invalidname { + return fmt.Errorf("BareMetalHost resource name cannot contain characters other than [A-Za-z0-9._-]") + } + + _, err := uuid.Parse(bmhname) + if err == nil { + return fmt.Errorf("BareMetalHost resource name cannot be a UUID") + } + + return nil +} diff --git a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_types.go b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_types.go new file mode 100644 index 00000000000..aa8b8e6995e --- /dev/null +++ b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_types.go @@ -0,0 +1,80 @@ +/* + + +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. +*/ + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + + // BMCEventSubscriptionFinalizer is the name of the finalizer added to + // subscriptions to block delete operations until the subscription is removed + // from the BMC. + BMCEventSubscriptionFinalizer string = "bmceventsubscription.metal3.io" +) + +type BMCEventSubscriptionSpec struct { + // A reference to a BareMetalHost + HostName string `json:"hostName,omitempty"` + + // A webhook URL to send events to + Destination string `json:"destination,omitempty"` + + // Arbitrary user-provided context for the event + Context string `json:"context,omitempty"` + + // A secret containing HTTP headers which should be passed along to the Destination + // when making a request + HTTPHeadersRef *corev1.SecretReference `json:"httpHeadersRef,omitempty"` +} + +type BMCEventSubscriptionStatus struct { + SubscriptionID string `json:"subscriptionID,omitempty"` + Error string `json:"error,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +// BMCEventSubscription is the Schema for the fast eventing API +// +k8s:openapi-gen=true +// +kubebuilder:resource:shortName=bes;bmcevent +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Error",type="string",JSONPath=".status.error",description="The most recent error message" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of BMCEventSubscription" +// +kubebuilder:object:root=true +type BMCEventSubscription struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec BMCEventSubscriptionSpec `json:"spec,omitempty"` + Status BMCEventSubscriptionStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// BMCEventSubscriptionList contains a list of BMCEventSubscriptions +type BMCEventSubscriptionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []BMCEventSubscription `json:"items"` +} + +func init() { + SchemeBuilder.Register(&BMCEventSubscription{}, &BMCEventSubscriptionList{}) +} diff --git a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_validation.go b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_validation.go new file mode 100644 index 00000000000..73b86dd6d5e --- /dev/null +++ b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_validation.go @@ -0,0 +1,54 @@ +/* + +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. +*/ + +package v1alpha1 + +import ( + "fmt" + "net/url" + + "github.com/pkg/errors" + + logf "sigs.k8s.io/controller-runtime/pkg/log" +) + +// bmclog is for logging in this package. +var bmclog = logf.Log.WithName("bmceventsubscription-validation") + +// validateSubscription validates BMCEventSubscription resource for creation +func (s *BMCEventSubscription) validateSubscription() []error { + bmclog.Info("validate create", "name", s.Name) + var errs []error + + if s.Spec.HostName == "" { + errs = append(errs, fmt.Errorf("HostName cannot be empty")) + } + + if s.Spec.Destination == "" { + errs = append(errs, fmt.Errorf("Destination cannot be empty")) + } else { + destinationUrl, err := url.ParseRequestURI(s.Spec.Destination) + + if err != nil { + errs = append(errs, errors.Wrap(err, "Destination is an invalid URL")) + } else { + if destinationUrl.Path == "" { + errs = append(errs, fmt.Errorf("Hostname-only destination must have a trailing slash")) + } + } + } + + return errs +} diff --git a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_webhook.go b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_webhook.go new file mode 100644 index 00000000000..9ddb237819c --- /dev/null +++ b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_webhook.go @@ -0,0 +1,67 @@ +/* +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. +*/ + +package v1alpha1 + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/util/errors" + + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + logf "sigs.k8s.io/controller-runtime/pkg/log" + "sigs.k8s.io/controller-runtime/pkg/webhook" +) + +// bmcsubscriptionlog is for logging in this package. +var bmcsubscriptionlog = logf.Log.WithName("bmceventsubscription-resource") + +func (s *BMCEventSubscription) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(s). + Complete() +} + +//+kubebuilder:webhook:verbs=create;update,path=/validate-metal3-io-v1alpha1-bmceventsubscription,mutating=false,failurePolicy=fail,sideEffects=none,admissionReviewVersions=v1;v1beta,groups=metal3.io,resources=bmceventsubscriptions,versions=v1alpha1,name=bmceventsubscription.metal3.io + +var _ webhook.Validator = &BMCEventSubscription{} + +// ValidateCreate implements webhook.Validator so a webhook will be registered for the type +func (s *BMCEventSubscription) ValidateCreate() error { + bmcsubscriptionlog.Info("validate create", "name", s.Name) + return errors.NewAggregate(s.validateSubscription()) +} + +// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type +// +// We prevent updates to the spec. All other updates (e.g. status, finalizers) are allowed. +func (s *BMCEventSubscription) ValidateUpdate(old runtime.Object) error { + bmcsubscriptionlog.Info("validate update", "name", s.Name) + + bes, casted := old.(*BMCEventSubscription) + if !casted { + bmcsubscriptionlog.Error(fmt.Errorf("old object conversion error"), "validate update error") + return nil + } + + if s.Spec != bes.Spec { + return fmt.Errorf("subscriptions cannot be updated, please recreate it") + } + + return nil +} + +// ValidateDelete implements webhook.Validator so a webhook will be registered for the type +func (s *BMCEventSubscription) ValidateDelete() error { + return nil +} diff --git a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/firmwareschema_types.go b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/firmwareschema_types.go index df76ff5dad9..8c7fc8527cd 100644 --- a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/firmwareschema_types.go +++ b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/firmwareschema_types.go @@ -18,6 +18,8 @@ package v1alpha1 import ( "fmt" + "strconv" + "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -48,9 +50,6 @@ type SettingSchema struct { // Whether or not this setting is read only. ReadOnly *bool `json:"read_only,omitempty"` - // Whether or not a reset is required after changing this setting. - ResetRequired *bool `json:"reset_required,omitempty"` - // Whether or not this setting's value is unique to this node, e.g. // a serial number. Unique *bool `json:"unique,omitempty"` @@ -71,6 +70,10 @@ func (schema *SettingSchema) Validate(name string, value intstr.IntOrString) err return SchemaSettingError{name: name, message: "it is ReadOnly"} } + if strings.Contains(name, "Password") { + return SchemaSettingError{name: name, message: "Password fields can't be set"} + } + // Check if valid based on type switch schema.AttributeType { case "Enumeration": @@ -82,11 +85,16 @@ func (schema *SettingSchema) Validate(name string, value intstr.IntOrString) err return SchemaSettingError{name: name, message: fmt.Sprintf("unknown enumeration value - %s", value.String())} case "Integer": + if value.Type == intstr.String { + if _, err := strconv.Atoi(value.String()); err != nil { + return SchemaSettingError{name: name, message: fmt.Sprintf("String %s entered while integer expected", value.String())} + } + } if schema.LowerBound != nil && value.IntValue() < *schema.LowerBound { - return SchemaSettingError{name: name, message: fmt.Sprintf("integer %s is below minimum value %d", value.String(), *schema.LowerBound)} + return SchemaSettingError{name: name, message: fmt.Sprintf("integer %d is below minimum value %d", value.IntValue(), *schema.LowerBound)} } if schema.UpperBound != nil && value.IntValue() > *schema.UpperBound { - return SchemaSettingError{name: name, message: fmt.Sprintf("integer %s is above maximum value %d", value.String(), *schema.UpperBound)} + return SchemaSettingError{name: name, message: fmt.Sprintf("integer %d is above maximum value %d", value.IntValue(), *schema.UpperBound)} } return nil diff --git a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostfirmwaresettings_types.go b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostfirmwaresettings_types.go index 8bca68d1483..c170e967e8d 100644 --- a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostfirmwaresettings_types.go +++ b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostfirmwaresettings_types.go @@ -37,19 +37,16 @@ type SettingsConditionType string const ( // Indicates that the settings in the Spec are different than Status - UpdateRequested SettingsConditionType = "UpdateRequested" + FirmwareSettingsChangeDetected SettingsConditionType = "ChangeDetected" // Indicates if the settings are valid and can be configured on the host - SettingsValid SettingsConditionType = "Valid" + FirmwareSettingsValid SettingsConditionType = "Valid" ) // HostFirmwareSettingsSpec defines the desired state of HostFirmwareSettings type HostFirmwareSettingsSpec struct { // Settings are the desired firmware settings stored as name/value pairs. - // This will be populated with the actual firmware settings and only - // contain the settings that can be modified (i.e. not ReadOnly), to - // facilitate making changes. // +patchStrategy=merge Settings DesiredSettingsMap `json:"settings" required:"true"` } @@ -61,9 +58,13 @@ type HostFirmwareSettingsStatus struct { // Namespace as the settings but it can be overwritten in the Spec FirmwareSchema *SchemaReference `json:"schema,omitempty"` - // Settings are the actual firmware settings stored as name/value pairs + // Settings are the firmware settings stored as name/value pairs Settings SettingsMap `json:"settings" required:"true"` + // Time that the status was last updated + // +optional + LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` + // Track whether settings stored in the spec are valid based on the schema // +patchMergeKey=type // +patchStrategy=merge diff --git a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/zz_generated.deepcopy.go index 0891f4eacfd..59d01baeeea 100644 --- a/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* @@ -56,6 +57,100 @@ func (in *BMCDetails) DeepCopy() *BMCDetails { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BMCEventSubscription) DeepCopyInto(out *BMCEventSubscription) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BMCEventSubscription. +func (in *BMCEventSubscription) DeepCopy() *BMCEventSubscription { + if in == nil { + return nil + } + out := new(BMCEventSubscription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BMCEventSubscription) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BMCEventSubscriptionList) DeepCopyInto(out *BMCEventSubscriptionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BMCEventSubscription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BMCEventSubscriptionList. +func (in *BMCEventSubscriptionList) DeepCopy() *BMCEventSubscriptionList { + if in == nil { + return nil + } + out := new(BMCEventSubscriptionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BMCEventSubscriptionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BMCEventSubscriptionSpec) DeepCopyInto(out *BMCEventSubscriptionSpec) { + *out = *in + if in.HTTPHeadersRef != nil { + in, out := &in.HTTPHeadersRef, &out.HTTPHeadersRef + *out = new(v1.SecretReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BMCEventSubscriptionSpec. +func (in *BMCEventSubscriptionSpec) DeepCopy() *BMCEventSubscriptionSpec { + if in == nil { + return nil + } + out := new(BMCEventSubscriptionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BMCEventSubscriptionStatus) DeepCopyInto(out *BMCEventSubscriptionStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BMCEventSubscriptionStatus. +func (in *BMCEventSubscriptionStatus) DeepCopy() *BMCEventSubscriptionStatus { + if in == nil { + return nil + } + out := new(BMCEventSubscriptionStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BareMetalHost) DeepCopyInto(out *BareMetalHost) { *out = *in @@ -584,6 +679,10 @@ func (in *HostFirmwareSettingsStatus) DeepCopyInto(out *HostFirmwareSettingsStat (*out)[key] = val } } + if in.LastUpdated != nil { + in, out := &in.LastUpdated, &out.LastUpdated + *out = (*in).DeepCopy() + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]metav1.Condition, len(*in)) @@ -959,11 +1058,6 @@ func (in *SettingSchema) DeepCopyInto(out *SettingSchema) { *out = new(bool) **out = **in } - if in.ResetRequired != nil { - in, out := &in.ResetRequired, &out.ResetRequired - *out = new(bool) - **out = **in - } if in.Unique != nil { in, out := &in.Unique, &out.Unique *out = new(bool) diff --git a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardware/profile.go b/vendor/github.com/metal3-io/baremetal-operator/pkg/hardware/profile.go index 7051475fcf0..55c38030f82 100644 --- a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardware/profile.go +++ b/vendor/github.com/metal3-io/baremetal-operator/pkg/hardware/profile.go @@ -83,6 +83,16 @@ func init() { LocalGB: 50, CPUArch: "x86_64", } + + profiles["openstack"] = Profile{ + Name: "openstack", + RootDeviceHints: metal3v1alpha1.RootDeviceHints{ + DeviceName: "/dev/vdb", + }, + RootGB: 10, + LocalGB: 50, + CPUArch: "x86_64", + } } // GetProfile returns the named profile diff --git a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/idrac.go b/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/idrac.go index b7b8cb844bb..2e99cbf7744 100644 --- a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/idrac.go +++ b/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/idrac.go @@ -91,7 +91,9 @@ func (a *iDracAccessDetails) PowerInterface() string { } func (a *iDracAccessDetails) RAIDInterface() string { - return "idrac-wsman" + // Disabled RAID in OpenShift because we are not ready to support it + //return "idrac-wsman" + return "no-raid" } func (a *iDracAccessDetails) VendorInterface() string { diff --git a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/ilo5.go b/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/ilo5.go index 2cfbee1fbf9..502447079f8 100644 --- a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/ilo5.go +++ b/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/ilo5.go @@ -87,7 +87,9 @@ func (a *iLO5AccessDetails) PowerInterface() string { } func (a *iLO5AccessDetails) RAIDInterface() string { - return "ilo5" + // Disabled RAID in OpenShift because we are not ready to support it + //return "ilo5" + return "no-raid" } func (a *iLO5AccessDetails) VendorInterface() string { diff --git a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/irmc.go b/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/irmc.go index c6b12f83820..a9c0b789ff7 100644 --- a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/irmc.go +++ b/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/irmc.go @@ -31,7 +31,9 @@ func (a *iRMCAccessDetails) Type() string { // NeedsMAC returns true when the host is going to need a separate // port created rather than having it discovered. func (a *iRMCAccessDetails) NeedsMAC() bool { - return false + // For the inspection to work, we need a MAC address + // https://github.com/metal3-io/baremetal-operator/pull/284#discussion_r317579040 + return true } func (a *iRMCAccessDetails) Driver() string { @@ -73,7 +75,7 @@ func (a *iRMCAccessDetails) BIOSInterface() string { } func (a *iRMCAccessDetails) BootInterface() string { - return "pxe" + return "ipxe" } func (a *iRMCAccessDetails) ManagementInterface() string { diff --git a/vendor/modules.txt b/vendor/modules.txt index 8eb3ad657a1..f185dfbf7d3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -523,14 +523,14 @@ github.com/mattn/go-isatty # github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 ## explicit; go 1.9 github.com/matttproud/golang_protobuf_extensions/pbutil -# github.com/metal3-io/baremetal-operator v0.0.0-20220128094204-28771f489634 => github.com/openshift/baremetal-operator v0.0.0-20211201170610-92ffa60c683d -## explicit; go 1.16 +# github.com/metal3-io/baremetal-operator v0.0.0-20220128094204-28771f489634 => github.com/openshift/baremetal-operator v0.0.0-20220128094204-28771f489634 +## explicit; go 1.17 github.com/metal3-io/baremetal-operator/pkg/hardware -# github.com/metal3-io/baremetal-operator/apis v0.0.0 => github.com/openshift/baremetal-operator/apis v0.0.0-20211201170610-92ffa60c683d -## explicit; go 1.16 +# github.com/metal3-io/baremetal-operator/apis v0.0.0 => github.com/openshift/baremetal-operator/apis v0.0.0-20220128094204-28771f489634 +## explicit; go 1.17 github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1 -# github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.0.0 => github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20211201170610-92ffa60c683d -## explicit; go 1.16 +# github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.0.0 => github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20220128094204-28771f489634 +## explicit; go 1.17 github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc # github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b ## explicit @@ -1336,9 +1336,9 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20211201170610-92ffa60c683d -# github.com/metal3-io/baremetal-operator/apis => github.com/openshift/baremetal-operator/apis v0.0.0-20211201170610-92ffa60c683d -# github.com/metal3-io/baremetal-operator/pkg/hardwareutils => github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20211201170610-92ffa60c683d +# github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20220128094204-28771f489634 +# github.com/metal3-io/baremetal-operator/apis => github.com/openshift/baremetal-operator/apis v0.0.0-20220128094204-28771f489634 +# github.com/metal3-io/baremetal-operator/pkg/hardwareutils => github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20220128094204-28771f489634 # sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210121023454-5ffc5f422a80 # sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20210626224711-5d94c794092f # sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20211111204942-611d320170af