diff --git a/go.mod b/go.mod index 4f1d662d8..187509f80 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/openshift/custom-resource-status v1.1.2 github.com/operator-framework/api v0.17.7-0.20230626210316-aa3e49803e7b github.com/prometheus/client_golang v1.17.0 - github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20231117061319-584d67fde60d + github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20231129111953-fda031ed2e1e github.com/stretchr/testify v1.8.4 go.uber.org/multierr v1.11.0 k8s.io/api v0.28.3 diff --git a/go.sum b/go.sum index 95a7bbde3..38d1b6ed0 100644 --- a/go.sum +++ b/go.sum @@ -705,8 +705,8 @@ github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20231117061319-584d67fde60d h1:kDYP0vyCFEzGZjTdajuW4hKONkhzRJKsZffqrzgQgGM= -github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20231117061319-584d67fde60d/go.mod h1:HYU4Tix2W8WOOl8zIryR+/xwPITW6i5mEPapDXsoL3c= +github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20231129111953-fda031ed2e1e h1:zJbO90mkhHCiup7pcJ42nHZ8ELrUGz7Cz4AGy32ZACQ= +github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20231129111953-fda031ed2e1e/go.mod h1:+WgcyIRhnW4QfLOW8UnpgTg7iVoM42U4ixzBW+j+1Q0= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= diff --git a/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/storagecluster_types.go b/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/storagecluster_types.go index b25d65c0c..96a4ff405 100644 --- a/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/storagecluster_types.go +++ b/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/storagecluster_types.go @@ -43,14 +43,21 @@ type StorageClusterSpec struct { // Placement is optional and used to specify placements of OCS components explicitly Placement rookCephv1.PlacementSpec `json:"placement,omitempty"` // Resources follows the conventions of and is mapped to CephCluster.Spec.Resources - Resources map[string]corev1.ResourceRequirements `json:"resources,omitempty"` - Encryption EncryptionSpec `json:"encryption,omitempty"` - StorageDeviceSets []StorageDeviceSet `json:"storageDeviceSets,omitempty"` - MonPVCTemplate *corev1.PersistentVolumeClaim `json:"monPVCTemplate,omitempty"` - MonDataDirHostPath string `json:"monDataDirHostPath,omitempty"` - Mgr *MgrSpec `json:"mgr,omitempty"` - MultiCloudGateway *MultiCloudGatewaySpec `json:"multiCloudGateway,omitempty"` - NFS *NFSSpec `json:"nfs,omitempty"` + Resources map[string]corev1.ResourceRequirements `json:"resources,omitempty"` + // Resource Profile can be used to choose from a set of predefined resource profiles for the ceph daemons. + // We have 3 profiles + // lean: suitable for clusters with limited resources, + // balanced: suitable for most use cases, + // performance: suitable for clusters with high amount of resources. + // +kubebuilder:validation:Enum=lean;Lean;balanced;Balanced;performance;Performance + ResourceProfile string `json:"resourceProfile,omitempty"` + Encryption EncryptionSpec `json:"encryption,omitempty"` + StorageDeviceSets []StorageDeviceSet `json:"storageDeviceSets,omitempty"` + MonPVCTemplate *corev1.PersistentVolumeClaim `json:"monPVCTemplate,omitempty"` + MonDataDirHostPath string `json:"monDataDirHostPath,omitempty"` + Mgr *MgrSpec `json:"mgr,omitempty"` + MultiCloudGateway *MultiCloudGatewaySpec `json:"multiCloudGateway,omitempty"` + NFS *NFSSpec `json:"nfs,omitempty"` // Monitoring controls the configuration of resources for exposing OCS metrics Monitoring *MonitoringSpec `json:"monitoring,omitempty"` // Version specifies the version of StorageCluster @@ -109,29 +116,15 @@ type StorageClusterSpec struct { // DefaultStorageProfile is the default storage profile to use for // the storageclassrequest as StorageProfile is optional. DefaultStorageProfile string `json:"defaultStorageProfile,omitempty"` - - StorageProfiles []StorageProfile `json:"storageProfiles,omitempty"` -} - -// StorageProfile is the storage profile to use for the storageclassrequest. -type StorageProfile struct { - // +kubebuilder:validation:Required - // Name of the storage profile. - Name string `json:"name"` - // +kubebuilder:validation:Required - // DeviceClass is the deviceclass name. - DeviceClass string `json:"deviceClass"` - // configurations to use for cephfilesystem. - SharedFilesystemConfiguration SharedFilesystemConfigurationSpec `json:"sharedFilesystemConfiguration,omitempty"` - // configurations to use for profile specific blockpool. - BlockPoolConfiguration BlockPoolConfigurationSpec `json:"blockPoolConfiguration,omitempty"` } type SharedFilesystemConfigurationSpec struct { + // +kubebuilder:validation:Optional Parameters map[string]string `json:"parameters,omitempty"` } type BlockPoolConfigurationSpec struct { + // +kubebuilder:validation:Optional Parameters map[string]string `json:"parameters,omitempty"` } @@ -171,6 +164,8 @@ type ManagedResourcesSpec struct { // ManageCephCluster defines how to reconcile the Ceph cluster definition type ManageCephCluster struct { ReconcileStrategy string `json:"reconcileStrategy,omitempty"` + // +kubebuilder:validation:Enum=1;2 + MgrCount int `json:"mgrCount,omitempty"` // +kubebuilder:validation:Enum=3;5 MonCount int `json:"monCount,omitempty"` } @@ -218,9 +213,10 @@ type ManageCephNonResilientPools struct { // ManageCephFilesystems defines how to reconcile CephFilesystems type ManageCephFilesystems struct { - ReconcileStrategy string `json:"reconcileStrategy,omitempty"` - DisableStorageClass bool `json:"disableStorageClass,omitempty"` - DisableSnapshotClass bool `json:"disableSnapshotClass,omitempty"` + ReconcileStrategy string `json:"reconcileStrategy,omitempty"` + DisableStorageClass bool `json:"disableStorageClass,omitempty"` + ActiveMetadataServers int `json:"activeMetadataServers,omitempty"` + DisableSnapshotClass bool `json:"disableSnapshotClass,omitempty"` // StorageClassName specifies the name of the storage class created for cephfs // +kubebuilder:validation:MaxLength=253 // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ @@ -231,7 +227,7 @@ type ManageCephFilesystems struct { type ManageCephObjectStores struct { ReconcileStrategy string `json:"reconcileStrategy,omitempty"` DisableStorageClass bool `json:"disableStorageClass,omitempty"` - GatewayInstances int32 `json:"gatewayInstances,omitempty"` + GatewayInstances int `json:"gatewayInstances,omitempty"` DisableRoute bool `json:"disableRoute,omitempty"` // StorageClassName specifies the name of the storage class created for ceph obc's // +kubebuilder:validation:MaxLength=253 diff --git a/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/storageprofile_types.go b/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/storageprofile_types.go new file mode 100644 index 000000000..5a3706f91 --- /dev/null +++ b/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/storageprofile_types.go @@ -0,0 +1,97 @@ +/* +Copyright 2020 Red Hat OpenShift Container Storage. + +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 v1 + +import ( + "crypto/md5" + "encoding/hex" + "encoding/json" + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// StorageProfileSpec defines the desired state of StorageProfile +type StorageProfileSpec struct { + // +kubebuilder:validation:Required + // +kubebuilder:validation:MaxLength=512 + // DeviceClass is the deviceclass name. + DeviceClass string `json:"deviceClass"` + + // +kubebuilder:validation:Optional + // configurations to use for cephfilesystem. + SharedFilesystemConfiguration SharedFilesystemConfigurationSpec `json:"sharedFilesystemConfiguration,omitempty"` + + // +kubebuilder:validation:Optional + // configurations to use for profile specific blockpool. + BlockPoolConfiguration BlockPoolConfigurationSpec `json:"blockPoolConfiguration,omitempty"` +} + +// StorageProfileStatus defines the observed state of StorageProfile +type StorageProfileStatus struct { + // Phase describes the Phase of StorageProfile + // This is used by OLM UI to provide status information + // to the user + Phase StorageProfilePhase `json:"phase,omitempty"` +} + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status + +// StorageProfile is the Schema for the storageprofiles API +type StorageProfile struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +kubebuilder:validation:Required + // +kubebuilder:validation:XValidation:rule="oldSelf == self",message="spec is immutable" + Spec StorageProfileSpec `json:"spec"` + Status StorageProfileStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// StorageProfileList contains a list of StorageProfile +type StorageProfileList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []StorageProfile `json:"items"` +} + +// StorageProfilePhase stores a StorageProfile reconciliation phase +type StorageProfilePhase string + +const ( + StorageProfilePhaseRejected StorageProfilePhase = "Rejected" +) + +func init() { + SchemeBuilder.Register(&StorageProfile{}, &StorageProfileList{}) +} + +func (sp *StorageProfile) GetSpecHash() string { + specJSON, err := json.Marshal(sp.Spec) + if err != nil { + errStr := fmt.Errorf("failed to marshal StorageProfile.Spec for %s", sp.Name) + panic(errStr) + } + specHash := md5.Sum(specJSON) + return hex.EncodeToString(specHash[:]) +} diff --git a/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/zz_generated.deepcopy.go b/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/zz_generated.deepcopy.go index f51659ea5..eb909b542 100644 --- a/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/red-hat-storage/ocs-operator/v4/api/v1/zz_generated.deepcopy.go @@ -812,13 +812,6 @@ func (in *StorageClusterSpec) DeepCopyInto(out *StorageClusterSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.StorageProfiles != nil { - in, out := &in.StorageProfiles, &out.StorageProfiles - *out = make([]StorageProfile, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClusterSpec. @@ -918,8 +911,10 @@ func (in *StorageDeviceSetConfig) DeepCopy() *StorageDeviceSetConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageProfile) DeepCopyInto(out *StorageProfile) { *out = *in - in.SharedFilesystemConfiguration.DeepCopyInto(&out.SharedFilesystemConfiguration) - in.BlockPoolConfiguration.DeepCopyInto(&out.BlockPoolConfiguration) + 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 StorageProfile. @@ -932,6 +927,78 @@ func (in *StorageProfile) DeepCopy() *StorageProfile { return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *StorageProfile) 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 *StorageProfileList) DeepCopyInto(out *StorageProfileList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]StorageProfile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageProfileList. +func (in *StorageProfileList) DeepCopy() *StorageProfileList { + if in == nil { + return nil + } + out := new(StorageProfileList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *StorageProfileList) 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 *StorageProfileSpec) DeepCopyInto(out *StorageProfileSpec) { + *out = *in + in.SharedFilesystemConfiguration.DeepCopyInto(&out.SharedFilesystemConfiguration) + in.BlockPoolConfiguration.DeepCopyInto(&out.BlockPoolConfiguration) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageProfileSpec. +func (in *StorageProfileSpec) DeepCopy() *StorageProfileSpec { + if in == nil { + return nil + } + out := new(StorageProfileSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageProfileStatus) DeepCopyInto(out *StorageProfileStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageProfileStatus. +func (in *StorageProfileStatus) DeepCopy() *StorageProfileStatus { + if in == nil { + return nil + } + out := new(StorageProfileStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in TopologyLabelValues) DeepCopyInto(out *TopologyLabelValues) { { diff --git a/vendor/modules.txt b/vendor/modules.txt index 456423906..b6bf43e0d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -287,7 +287,7 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20231117061319-584d67fde60d +# github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20231129111953-fda031ed2e1e ## explicit; go 1.20 github.com/red-hat-storage/ocs-operator/v4/api/v1 # github.com/rook/rook/pkg/apis v0.0.0-20231113194457-5230fcd60dd1