diff --git a/pkg/schemes/ocs/operatorv1/groupversion_info.go b/pkg/schemes/ocs/operatorv1/groupversion_info.go index 4b361cb67..8cddcc674 100644 --- a/pkg/schemes/ocs/operatorv1/groupversion_info.go +++ b/pkg/schemes/ocs/operatorv1/groupversion_info.go @@ -43,7 +43,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(GroupVersion, &OCSInitialization{}, &OCSInitializationList{}, &StorageCluster{}, &StorageClusterList{}, - &StorageProfile{}, &StorageProfileList{}, &StorageClusterPeer{}, &StorageClusterPeerList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) diff --git a/pkg/schemes/ocs/operatorv1/storagecluster_types.go b/pkg/schemes/ocs/operatorv1/storagecluster_types.go index a9588476e..5d16b417f 100644 --- a/pkg/schemes/ocs/operatorv1/storagecluster_types.go +++ b/pkg/schemes/ocs/operatorv1/storagecluster_types.go @@ -127,16 +127,6 @@ type CSIDriverSpec struct { ReadAffinity *rookCephv1.ReadAffinitySpec `json:"readAffinity,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"` -} - // BackingStorageClass defines the backing storageclass for StorageDeviceSet type BackingStorageClass struct { metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/schemes/ocs/operatorv1/storageprofile_types.go b/pkg/schemes/ocs/operatorv1/storageprofile_types.go deleted file mode 100644 index 471efa70c..000000000 --- a/pkg/schemes/ocs/operatorv1/storageprofile_types.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -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 operatorv1 - -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 (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/pkg/schemes/ocs/operatorv1/zz_generated.deepcopy.go b/pkg/schemes/ocs/operatorv1/zz_generated.deepcopy.go index 2b2707458..e163843ab 100644 --- a/pkg/schemes/ocs/operatorv1/zz_generated.deepcopy.go +++ b/pkg/schemes/ocs/operatorv1/zz_generated.deepcopy.go @@ -72,28 +72,6 @@ func (in *BackingStorageClass) DeepCopy() *BackingStorageClass { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BlockPoolConfigurationSpec) DeepCopyInto(out *BlockPoolConfigurationSpec) { - *out = *in - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockPoolConfigurationSpec. -func (in *BlockPoolConfigurationSpec) DeepCopy() *BlockPoolConfigurationSpec { - if in == nil { - return nil - } - out := new(BlockPoolConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CSIDriverSpec) DeepCopyInto(out *CSIDriverSpec) { *out = *in @@ -755,28 +733,6 @@ func (in *RookCephOperatorConfigStatus) DeepCopy() *RookCephOperatorConfigStatus return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SharedFilesystemConfigurationSpec) DeepCopyInto(out *SharedFilesystemConfigurationSpec) { - *out = *in - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedFilesystemConfigurationSpec. -func (in *SharedFilesystemConfigurationSpec) DeepCopy() *SharedFilesystemConfigurationSpec { - if in == nil { - return nil - } - out := new(SharedFilesystemConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageCluster) DeepCopyInto(out *StorageCluster) { *out = *in @@ -1128,97 +1084,6 @@ func (in *StorageDeviceSetConfig) DeepCopy() *StorageDeviceSetConfig { return out } -// 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 - 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. -func (in *StorageProfile) DeepCopy() *StorageProfile { - if in == nil { - return nil - } - out := new(StorageProfile) - in.DeepCopyInto(out) - 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) { {